0

After installed, trying to login admin panel getting an error,

Warning: class_implements(): Class � does not exist and could not be loaded in C:\xampp\htdocs\abc\vendor\magento\framework\Code\Reader\ClassReader.php on line 64

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Framework\Code\Reader;

class ClassReader implements ClassReaderInterface
{
    /**
     * Read class constructor signature
     *
     * @param string $className
     * @return array|null
     * @throws \ReflectionException
     */
    public function getConstructor($className)
    {
        $class = new \ReflectionClass($className);
        $result = null;
        $constructor = $class->getConstructor();
        if ($constructor) {
            $result = [];
            /** @var $parameter \ReflectionParameter */
            foreach ($constructor->getParameters() as $parameter) {
                try {
                    $result[] = [
                        $parameter->getName(),
                        $parameter->getClass() !== null ? $parameter->getClass()->getName() : null,
                        !$parameter->isOptional(),
                        $parameter->isOptional()
                            ? ($parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null)
                            : null,
                    ];
                } catch (\ReflectionException $e) {
                    $message = $e->getMessage();
                    throw new \ReflectionException($message, 0, $e);
                }
            }
        }

        return $result;
    }

    /**
     * Retrieve parent relation information for type in a following format
     * array(
     *     'Parent_Class_Name',
     *     'Interface_1',
     *     'Interface_2',
     *     ...
     * )
     *
     * @param string $className
     * @return string[]
     */
    public function getParents($className)
    {
        $parentClass = get_parent_class($className);
        if ($parentClass) {
            $result = [];
            $interfaces = class_implements($className);
            if ($interfaces) {
                $parentInterfaces = class_implements($parentClass);
                if ($parentInterfaces) {
                    $result = array_values(array_diff($interfaces, $parentInterfaces));
                } else {
                    $result = array_values($interfaces);
                }
            }
            array_unshift($result, $parentClass);
        } else {
            $result = array_values(class_implements($className));
            if ($result) {
                array_unshift($result, null);
            } else {
                $result = [];
            }
        }
        return $result;
    }
}

How can i solve the error.

  • what php version you are using? – akgola Oct 27 '17 at 11:34
  • magento ver 2.2.0 – zus Oct 27 '17 at 11:35
  • If you're using Magento 2.2.0, please update the title. Also you did not answer the question about the PHP version. – mkotov Oct 27 '17 at 16:07
  • Is the ClassReaderInterface in the same directory? Does it exist? – CompactCode Oct 28 '17 at 23:30
  • Please update the title because it is misleading. This is NOT related to 2.2.1. – Jisse Reitsma Nov 7 '17 at 20:59
1

Please delete the following folder.

var/generation,var/cache and var/page_cache.

I have also face the same issue and fixed by deletion of above folder.

I hope it will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.