1 | <?php |
||
20 | class ReflectionMethod extends BaseReflectionMethod |
||
21 | { |
||
22 | use ReflectionFunctionLikeTrait; |
||
23 | |||
24 | /** |
||
25 | * Name of the class |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | private $className; |
||
30 | |||
31 | /** |
||
32 | * Initializes reflection instance for the method node |
||
33 | * |
||
34 | * @param string $className Name of the class |
||
35 | * @param string $methodName Name of the method |
||
36 | * @param ClassMethod $classMethodNode AST-node for method |
||
37 | */ |
||
38 | 4 | public function __construct($className, $methodName, ClassMethod $classMethodNode = null) |
|
44 | |||
45 | /** |
||
46 | * Emulating original behaviour of reflection |
||
47 | */ |
||
48 | public function __debugInfo() |
||
49 | { |
||
50 | return [ |
||
51 | 'name' => $this->getClassMethodNode()->name, |
||
52 | 'class' => $this->className |
||
53 | ]; |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Returns the string representation of the Reflection method object. |
||
58 | * |
||
59 | * @link http://php.net/manual/en/reflectionmethod.tostring.php |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 1 | public function __toString() |
|
91 | |||
92 | /** |
||
93 | * {@inheritDoc} |
||
94 | */ |
||
95 | public function getClosure($object) |
||
101 | |||
102 | /** |
||
103 | * {@inheritDoc} |
||
104 | */ |
||
105 | 2 | public function getDeclaringClass() |
|
109 | |||
110 | /** |
||
111 | * {@inheritDoc} |
||
112 | */ |
||
113 | 1 | public function getModifiers() |
|
137 | |||
138 | /** |
||
139 | * {@inheritDoc} |
||
140 | */ |
||
141 | public function getPrototype() |
||
155 | |||
156 | /** |
||
157 | * {@inheritDoc} |
||
158 | */ |
||
159 | public function invoke($object, $args = null) |
||
165 | |||
166 | /** |
||
167 | * {@inheritDoc} |
||
168 | */ |
||
169 | public function invokeArgs($object, array $args) |
||
175 | |||
176 | /** |
||
177 | * {@inheritDoc} |
||
178 | */ |
||
179 | 1 | public function isAbstract() |
|
183 | |||
184 | /** |
||
185 | * {@inheritDoc} |
||
186 | */ |
||
187 | 1 | public function isConstructor() |
|
191 | |||
192 | /** |
||
193 | * {@inheritDoc} |
||
194 | */ |
||
195 | 1 | public function isDestructor() |
|
199 | |||
200 | /** |
||
201 | * {@inheritDoc} |
||
202 | */ |
||
203 | 1 | public function isFinal() |
|
207 | |||
208 | /** |
||
209 | * {@inheritDoc} |
||
210 | */ |
||
211 | 1 | public function isPrivate() |
|
215 | |||
216 | /** |
||
217 | * {@inheritDoc} |
||
218 | */ |
||
219 | 1 | public function isProtected() |
|
223 | |||
224 | /** |
||
225 | * {@inheritDoc} |
||
226 | */ |
||
227 | 2 | public function isPublic() |
|
231 | |||
232 | /** |
||
233 | * {@inheritDoc} |
||
234 | */ |
||
235 | 1 | public function isStatic() |
|
239 | |||
240 | /** |
||
241 | * {@inheritDoc} |
||
242 | */ |
||
243 | public function setAccessible($accessible) |
||
249 | |||
250 | /** |
||
251 | * Implementation of internal reflection initialization |
||
252 | * |
||
253 | * @return void |
||
254 | */ |
||
255 | protected function __initialize() |
||
259 | |||
260 | /** |
||
261 | * Returns ClassMethod node to prevent all possible type checks with instanceof |
||
262 | * |
||
263 | * @return ClassMethod |
||
264 | */ |
||
265 | 2 | private function getClassMethodNode() |
|
269 | } |
||
270 |