Pinq\Parsing\PhpParser\AST::convert PHP Method

convert() public static method

Converts the supplied php parser nodes to an equivalent expression tree.
public static convert ( array $nodes ) : Expression[]
$nodes array
return Pinq\Expressions\Expression[]
    public static function convert(array $nodes)
    {
        return (new self($nodes))->getExpressions();
    }

Usage Example

Exemplo n.º 1
0
 protected function parseFunction(IFunctionReflection $reflection, $filePath)
 {
     if (self::$phpParser === null) {
         self::$phpParser = new PhpParser\Parser(new PhpParser\Lexer());
     }
     $locatedFunctionNodes = $this->getLocatedFunctionNodesIn($filePath);
     $matchingFunctionNode = $this->getMatchingFunctionNode($locatedFunctionNodes, $reflection);
     return new FunctionStructure($matchingFunctionNode->getDeclaration(), AST::convert($matchingFunctionNode->getBodyNodes()));
 }
All Usage Examples Of Pinq\Parsing\PhpParser\AST::convert