1 | <?php |
||
22 | final class AddProxiedMethods extends NodeVisitorAbstract |
||
23 | { |
||
24 | /** @var string */ |
||
25 | private $resolverProperty; |
||
26 | |||
27 | /** @var Node\Stmt\ClassMethod[] */ |
||
28 | private $methods; |
||
29 | |||
30 | /** @var string */ |
||
31 | private $resolveMethod; |
||
32 | |||
33 | /** |
||
34 | * @param string $property |
||
35 | * @param array $methods |
||
36 | * @param string $resolveMethod |
||
37 | */ |
||
38 | public function __construct(string $property, array $methods, string $resolveMethod) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function leaveNode(Node $node) |
||
68 | |||
69 | /** |
||
70 | * @param Node\Stmt\ClassMethod $method |
||
71 | * @return bool |
||
72 | */ |
||
73 | private function hasReturnStmt(Node\Stmt\ClassMethod $method): bool |
||
89 | |||
90 | /** |
||
91 | * @param Node\Stmt|Node\Stmt\ClassMethod $node |
||
92 | * @return bool |
||
93 | */ |
||
94 | private function findReturnStmt(Node\Stmt $node): bool |
||
112 | |||
113 | /** |
||
114 | * @param Node\Stmt\ClassMethod $method |
||
115 | * @param string $stmtWrapper |
||
116 | * @return Node\Stmt\ClassMethod |
||
117 | */ |
||
118 | private function modifyMethodMethod(Node\Stmt\ClassMethod $method, string $stmtWrapper): Node\Stmt\ClassMethod |
||
128 | |||
129 | /** |
||
130 | * @param Node\Stmt\ClassMethod $method |
||
131 | * @return array |
||
132 | */ |
||
133 | private function packMethodArgs(Node\Stmt\ClassMethod $method): array |
||
143 | } |
||
144 |