Пример #1
0
 /**
  * Extracts all dependencies from a callable body.
  *
  * @return \PDepend\Source\AST\ASTScope
  * @since  0.9.12
  */
 private function parseScope()
 {
     $scope = $this->builder->buildAstScope();
     $this->tokenStack->push();
     $this->consumeComments();
     $this->consumeToken(Tokens::T_CURLY_BRACE_OPEN);
     while (($stmt = $this->parseOptionalStatement()) !== null) {
         // TODO: Remove if-statement once, we have translated functions and
         //       closures into ast-nodes
         if ($stmt instanceof \PDepend\Source\AST\ASTNode) {
             $scope->addChild($stmt);
         }
     }
     $this->consumeComments();
     $this->consumeToken(Tokens::T_CURLY_BRACE_CLOSE);
     return $this->setNodePositionsAndReturn($scope);
 }