src/ReflectionFileNamespace.php
private function findFunctions()
    {
        $functions     = array();
        $namespaceName = $this->getName();

        // functions can be only top-level nodes in the namespace, so we can scan them directly
        foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
            if ($namespaceLevelNode instanceof Function_) {
                $funcShortName = $namespaceLevelNode->name->toString();
                $functionName  = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName;

                $namespaceLevelNode->setAttribute('fileName', $this->fileName);
                $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode);
            }
        }

        return $functions;
    }
private function findFunctions()
    {
        $functions     = array();
        $namespaceName = $this->getName();

        // functions can be only top-level nodes in the namespace, so we can scan them directly
        foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
            if ($namespaceLevelNode instanceof Function_) {
                $funcShortName = $namespaceLevelNode->name->toString();
                $functionName  = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName;

                $namespaceLevelNode->setAttribute('fileName', $this->fileName);
                $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode);
            }
        }

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

@return array
Searches for functions in the given AST