예제 #1
0
파일: Parser.php 프로젝트: timetoogo/pinq
 protected function parseFunction(IFunctionReflection $reflection, $filePath)
 {
     if (self::$phpParser === null) {
         self::$phpParser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);
     }
     $locatedFunctionNodes = $this->getLocatedFunctionNodesIn($filePath);
     $matchingFunctionNode = $this->getMatchingFunctionNode($locatedFunctionNodes, $reflection);
     return new FunctionStructure($matchingFunctionNode->getDeclaration(), AST::convert($matchingFunctionNode->getBodyNodes()));
 }
예제 #2
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()));
 }