1: <?php declare(strict_types = 1);
2:
3: namespace PHPStan\Node;
4:
5: use PhpParser\Node\PropertyHook;
6: use PhpParser\NodeAbstract;
7: use PHPStan\Analyser\ImpurePoint;
8: use PHPStan\Analyser\StatementResult;
9: use PHPStan\Reflection\ClassReflection;
10: use PHPStan\Reflection\Php\PhpMethodFromParserNodeReflection;
11: use PHPStan\Reflection\Php\PhpPropertyReflection;
12:
13: /**
14: * @api
15: */
16: final class PropertyHookReturnStatementsNode extends NodeAbstract implements ReturnStatementsNode
17: {
18:
19: /**
20: * @param list<ReturnStatement> $returnStatements
21: * @param list<ExecutionEndNode> $executionEnds
22: * @param ImpurePoint[] $impurePoints
23: */
24: public function __construct(
25: private PropertyHook $hook,
26: private array $returnStatements,
27: private StatementResult $statementResult,
28: private array $executionEnds,
29: private array $impurePoints,
30: private ClassReflection $classReflection,
31: private PhpMethodFromParserNodeReflection $hookReflection,
32: private PhpPropertyReflection $propertyReflection,
33: )
34: {
35: parent::__construct($hook->getAttributes());
36: }
37:
38: public function getPropertyHookNode(): PropertyHook
39: {
40: return $this->hook;
41: }
42:
43: public function returnsByRef(): bool
44: {
45: return $this->hook->byRef;
46: }
47:
48: public function hasNativeReturnTypehint(): bool
49: {
50: return false;
51: }
52:
53: public function getYieldStatements(): array
54: {
55: return [];
56: }
57:
58: public function isGenerator(): bool
59: {
60: return false;
61: }
62:
63: public function getReturnStatements(): array
64: {
65: return $this->returnStatements;
66: }
67:
68: public function getStatementResult(): StatementResult
69: {
70: return $this->statementResult;
71: }
72:
73: public function getExecutionEnds(): array
74: {
75: return $this->executionEnds;
76: }
77:
78: public function getImpurePoints(): array
79: {
80: return $this->impurePoints;
81: }
82:
83: public function getClassReflection(): ClassReflection
84: {
85: return $this->classReflection;
86: }
87:
88: public function getHookReflection(): PhpMethodFromParserNodeReflection
89: {
90: return $this->hookReflection;
91: }
92:
93: public function getPropertyReflection(): PhpPropertyReflection
94: {
95: return $this->propertyReflection;
96: }
97:
98: public function getType(): string
99: {
100: return 'PHPStan_Node_PropertyHookReturnStatementsNode';
101: }
102:
103: /**
104: * @return string[]
105: */
106: public function getSubNodeNames(): array
107: {
108: return [];
109: }
110:
111: }
112: