1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use PhpParser\Node\Expr\Yield_;
6: use PhpParser\Node\Expr\YieldFrom;
7: use PHPStan\Analyser\ImpurePoint;
8: use PHPStan\Analyser\StatementResult;
9:
10: /**
11: * @api
12: * @api-do-not-implement
13: */
14: interface ReturnStatementsNode extends VirtualNode
15: {
16:
17: /**
18: * @return list<ReturnStatement>
19: */
20: public function getReturnStatements(): array;
21:
22: /**
23: * Return statements from try or catch blocks, with the scope updated
24: * by the changes made in the following finally block.
25: *
26: * Only relevant for functions returning by reference - the value the caller
27: * receives is read after the finally block has run.
28: *
29: * @return list<ReturnStatement>
30: */
31: public function getReturnStatementsAfterFinally(): array;
32:
33: public function getStatementResult(): StatementResult;
34:
35: /**
36: * @return list<ExecutionEndNode>
37: */
38: public function getExecutionEnds(): array;
39:
40: /**
41: * @return ImpurePoint[]
42: */
43: public function getImpurePoints(): array;
44:
45: public function returnsByRef(): bool;
46:
47: public function hasNativeReturnTypehint(): bool;
48:
49: /**
50: * @return list<Yield_|YieldFrom>
51: */
52: public function getYieldStatements(): array;
53:
54: public function isGenerator(): bool;
55:
56: }
57: