1 | <?php |
||
26 | final class AddProxiedMethods extends NodeVisitorAbstract |
||
27 | { |
||
28 | /** @var string */ |
||
29 | private $class; |
||
30 | |||
31 | /** @var string */ |
||
32 | private $resolverProperty; |
||
33 | |||
34 | /** @var Node\Stmt\ClassMethod[] */ |
||
35 | private $methods; |
||
36 | |||
37 | /** @var string */ |
||
38 | private $resolveMethod; |
||
39 | |||
40 | /** |
||
41 | * @param string $class |
||
42 | * @param string $property |
||
43 | * @param array $methods |
||
44 | * @param string $resolveMethod |
||
45 | */ |
||
46 | public function __construct(string $class, string $property, array $methods, string $resolveMethod) |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function leaveNode(Node $node) |
||
77 | |||
78 | /** |
||
79 | * @param Node\Stmt\ClassMethod $method |
||
80 | * @return bool |
||
81 | */ |
||
82 | private function hasReturnStmt(Node\Stmt\ClassMethod $method): bool |
||
98 | |||
99 | /** |
||
100 | * @param Node\Stmt|Node\Stmt\ClassMethod $node |
||
101 | * @return bool |
||
102 | */ |
||
103 | private function findReturnStmt(Node\Stmt $node): bool |
||
121 | |||
122 | /** |
||
123 | * @param Node\Stmt\ClassMethod $method |
||
124 | * @param string $stmtWrapper |
||
125 | * @return Node\Stmt\ClassMethod |
||
126 | */ |
||
127 | private function modifyMethodMethod(Node\Stmt\ClassMethod $method, string $stmtWrapper): Node\Stmt\ClassMethod |
||
147 | |||
148 | /** |
||
149 | * @param Node\Stmt\ClassMethod $method |
||
150 | * @return array |
||
151 | */ |
||
152 | private function packMethodArgs(Node\Stmt\ClassMethod $method): array |
||
162 | } |
||
163 |