1 | <?php |
||
18 | final class CodeGenMethod |
||
19 | { |
||
20 | /** |
||
21 | * @var \PHPParser\Parser |
||
22 | */ |
||
23 | private $parser; |
||
24 | |||
25 | /** |
||
26 | * @var \PHPParser\BuilderFactory |
||
27 | */ |
||
28 | private $factory; |
||
29 | |||
30 | /** |
||
31 | * @var \PHPParser\PrettyPrinter\Standard |
||
32 | */ |
||
33 | private $printer; |
||
34 | |||
35 | private $reader; |
||
36 | |||
37 | /** |
||
38 | * @var AbstractAssisted |
||
39 | */ |
||
40 | private $assisted = []; |
||
41 | |||
42 | /** |
||
43 | * @param \PHPParser\Parser $parser |
||
44 | * @param \PHPParser\BuilderFactory $factory |
||
45 | * @param \PHPParser\PrettyPrinter\Standard $printer |
||
46 | */ |
||
47 | 24 | public function __construct( |
|
57 | |||
58 | /** |
||
59 | * @param \ReflectionClass $class |
||
60 | * |
||
61 | * @return array |
||
62 | */ |
||
63 | 9 | public function getMethods(\ReflectionClass $class, BindInterface $bind) |
|
79 | |||
80 | /** |
||
81 | * Return method statement |
||
82 | * |
||
83 | * @param \ReflectionMethod $method |
||
84 | * |
||
85 | * @return \PhpParser\Node\Stmt\ClassMethod |
||
86 | */ |
||
87 | 8 | private function getMethod(\ReflectionMethod $method) |
|
100 | |||
101 | /** |
||
102 | * Return parameter reflection |
||
103 | * |
||
104 | * @param \ReflectionParameter $param |
||
105 | * @param \PHPParser\Builder\Method $methodStmt |
||
106 | * |
||
107 | * @return \PHPParser\Builder\Method |
||
108 | */ |
||
109 | 8 | private function getMethodStatement(\ReflectionParameter $param, Method $methodStmt) |
|
121 | |||
122 | /** |
||
123 | * @param Method $methodStmt |
||
124 | * @param \ReflectionMethod $method |
||
125 | * |
||
126 | * @return \PhpParser\Node\Stmt\ClassMethod |
||
127 | */ |
||
128 | 8 | private function addMethodDocComment(Method $methodStmt, \ReflectionMethod $method) |
|
138 | |||
139 | /** |
||
140 | * @return \PHPParser\Node[] |
||
141 | */ |
||
142 | 8 | private function getMethodInsideStatement() |
|
151 | |||
152 | /** |
||
153 | * @param \ReflectionParameter $param |
||
154 | * @param Param $paramStmt |
||
155 | * @param \ReflectionClass $typeHint |
||
156 | */ |
||
157 | 8 | private function setTypeHint(\ReflectionParameter $param, Param $paramStmt, \ReflectionClass $typeHint = null) |
|
169 | |||
170 | /** |
||
171 | * @param \ReflectionParameter $param |
||
172 | * @param Param $paramStmt |
||
173 | */ |
||
174 | 8 | private function setDefault(\ReflectionParameter $param, $paramStmt) |
|
185 | } |
||
186 |