/** * Parses all statements that exist in a scope an adds them to a scope * instance. * * @return \PDepend\Source\AST\ASTScopeStatement * @since 0.10.0 */ private function parseScopeStatements() { $scope = $this->builder->buildAstScopeStatement(); while (($child = $this->parseOptionalStatement()) != null) { if ($child instanceof \PDepend\Source\AST\ASTNode) { $scope->addChild($child); } } return $scope; }