PDepend\Source\Language\PHP\AbstractPHPParser::parseScope PHP Method

parseScope() private method

Extracts all dependencies from a callable body.
Since: 0.9.12
private parseScope ( ) : PDepend\Source\AST\ASTScope
return PDepend\Source\AST\ASTScope
    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);
    }
AbstractPHPParser