src/ReflectionFileNamespace.php
private function findClasses()
    {
        $classes       = array();
        $namespaceName = $this->getName();
        // classes can be only top-level nodes in the namespace, so we can scan them directly
        foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
            if ($namespaceLevelNode instanceof ClassLike) {
                $classShortName = $namespaceLevelNode->name->toString();
                $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName;

                $namespaceLevelNode->setAttribute('fileName', $this->fileName);
                $classes[$className] = new ReflectionClass($className, $namespaceLevelNode);
            }
        }

        return $classes;
    }
private function findClasses()
    {
        $classes       = array();
        $namespaceName = $this->getName();
        // classes can be only top-level nodes in the namespace, so we can scan them directly
        foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
            if ($namespaceLevelNode instanceof ClassLike) {
                $classShortName = $namespaceLevelNode->name->toString();
                $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName;

                $namespaceLevelNode->setAttribute('fileName', $this->fileName);
                $classes[$className] = new ReflectionClass($className, $namespaceLevelNode);
            }
        }

        return $classes;
    }
private function findClasses ( ) { $ classes = array ( ) ; $ namespaceName = $ this -> getName ( ) ; // classes can be only top-level nodes in the namespace, so we can scan them directly foreach ( $ this -> namespaceNode -> stmts as $ namespaceLevelNode ) { if ( $ namespaceLevelNode instanceof ClassLike ) { $ classShortName = $ namespaceLevelNode -> name -> toString ( ) ; $ className = $ namespaceName ? $ namespaceName . '\\' . $ classShortName : $ classShortName ; $ namespaceLevelNode -> setAttribute ( 'fileName' , $ this -> fileName ) ; $ classes [ $ className ] = new ReflectionClass ( $ className , $ namespaceLevelNode ) ; } } return $ classes ; }
Searches for classes in the given AST

@return array|ReflectionClass[]
Searches for classes in the given AST