/** * This method parses a single return-statement node. * * @return \PDepend\Source\AST\ASTReturnStatement * @since 0.9.12 */ private function parseReturnStatement() { $this->tokenStack->push(); $token = $this->consumeToken(Tokens::T_RETURN); $stmt = $this->builder->buildAstReturnStatement($token->image); if (($expr = $this->parseOptionalExpression()) != null) { $stmt->addChild($expr); } $this->parseStatementTermination(); return $this->setNodePositionsAndReturn($stmt); }