1: <?php
2: namespace Pharborist\ControlStructures;
3:
4: use Pharborist\StatementNode;
5: use Pharborist\Parser;
6: use Pharborist\ExpressionNode;
7:
8: 9: 10:
11: class ReturnStatementNode extends StatementNode {
12: 13: 14:
15: protected $expression;
16:
17: 18: 19: 20: 21: 22: 23: 24:
25: public static function create(ExpressionNode $expr) {
26: return Parser::parseSnippet('return ' . $expr->getText() . ';');
27: }
28:
29: 30: 31:
32: public function getExpression() {
33: return $this->expression;
34: }
35: }
36: