Author: Elliot Levin (elliotlevin@hotmail.com)
コード例 #1
0
ファイル: Parser.php プロジェクト: Goldinteractive/Pinq
 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()));
 }
コード例 #2
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()));
 }
コード例 #3
0
 /**
  * @param Node\Param[] $parameters
  *
  * @return O\ParameterExpression[]
  */
 private function getParameterExpressions(array $parameters)
 {
     return AST::convert($parameters);
 }