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