lib/Accessible/Reader/Reader.php
public static function getClassesToRead(\ReflectionObject $reflectionObject)
    {
        $cacheId = md5("classesToRead:" . $reflectionObject->getName());
        $objectClasses = self::getFromCache($cacheId);
        if ($objectClasses !== null) {
            return $objectClasses;
        }

        $objectClasses = array($reflectionObject);
        $objectTraits = $reflectionObject->getTraits();
        if (!empty($objectTraits)) {
            foreach ($objectTraits as $trait) {
                $objectClasses[] = $trait;
            }
        }

        $parentClass = $reflectionObject->getParentClass();
        while ($parentClass) {
            $objectClasses[] = $parentClass;

            $parentTraits = $parentClass->getTraits();
            if (!empty($parentTraits)) {
                foreach ($parentTraits as $trait) {
                    $objectClasses[] = $trait;
                }
            }

            $parentClass = $parentClass->getParentClass();
        }

        self::saveToCache($cacheId, $objectClasses);

        return $objectClasses;
    }
public static function getClassesToRead(\ReflectionObject $reflectionObject)
    {
        $cacheId = md5("classesToRead:" . $reflectionObject->getName());
        $objectClasses = self::getFromCache($cacheId);
        if ($objectClasses !== null) {
            return $objectClasses;
        }

        $objectClasses = array($reflectionObject);
        $objectTraits = $reflectionObject->getTraits();
        if (!empty($objectTraits)) {
            foreach ($objectTraits as $trait) {
                $objectClasses[] = $trait;
            }
        }

        $parentClass = $reflectionObject->getParentClass();
        while ($parentClass) {
            $objectClasses[] = $parentClass;

            $parentTraits = $parentClass->getTraits();
            if (!empty($parentTraits)) {
                foreach ($parentTraits as $trait) {
                    $objectClasses[] = $trait;
                }
            }

            $parentClass = $parentClass->getParentClass();
        }

        self::saveToCache($cacheId, $objectClasses);

        return $objectClasses;
    }
public static function getClassesToRead ( \ ReflectionObject $ reflectionObject ) { $ cacheId = md5 ( "classesToRead:" . $ reflectionObject -> getName ( ) ) ; $ objectClasses = self :: getFromCache ( $ cacheId ) ; if ( $ objectClasses !== null ) { return $ objectClasses ; } $ objectClasses = array ( $ reflectionObject ) ; $ objectTraits = $ reflectionObject -> getTraits ( ) ; if ( ! empty ( $ objectTraits ) ) { foreach ( $ objectTraits as $ trait ) { $ objectClasses [ ] = $ trait ; } } $ parentClass = $ reflectionObject -> getParentClass ( ) ; while ( $ parentClass ) { $ objectClasses [ ] = $ parentClass ; $ parentTraits = $ parentClass -> getTraits ( ) ; if ( ! empty ( $ parentTraits ) ) { foreach ( $ parentTraits as $ trait ) { $ objectClasses [ ] = $ trait ; } } $ parentClass = $ parentClass -> getParentClass ( ) ; } self :: saveToCache ( $ cacheId , $ objectClasses ) ; return $ objectClasses ; }
Get a list of classes and traits to analyze.

@param \ReflectionObject $reflectionObject The object to get the parents from.

@return array The list of classes to read.
Get a list of classes and traits to analyze .