1 | <?php |
||
21 | class ReflectedMethod { |
||
22 | |||
23 | CONST VISIBILITY_PUBLIC = 1; |
||
24 | CONST VISIBILITY_PRIVATE = 2; |
||
25 | CONST VISIBILITY_PROTECTED = 3; |
||
26 | CONST STATE_LOCAL = 1; |
||
27 | CONST STATE_STATIC = 2; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $name; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | private $arguments = array(); |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | private $returns = array(); |
||
44 | |||
45 | /** |
||
46 | * @var array |
||
47 | */ |
||
48 | private $internalCalls = array(); |
||
49 | |||
50 | /** |
||
51 | * @var array |
||
52 | */ |
||
53 | private $externalCalls = array(); |
||
54 | |||
55 | /** |
||
56 | * @var array |
||
57 | */ |
||
58 | private $dependencies = array(); |
||
59 | |||
60 | /** |
||
61 | * Resolver for names |
||
62 | * |
||
63 | * @var NameResolver |
||
64 | */ |
||
65 | private $nameResolver; |
||
66 | |||
67 | /** |
||
68 | * @var array |
||
69 | */ |
||
70 | private $tokens = array(); |
||
71 | |||
72 | /** |
||
73 | * @var string |
||
74 | */ |
||
75 | private $content; |
||
76 | |||
77 | /** |
||
78 | * Usage of method (getter, setter...) |
||
79 | * |
||
80 | * @var string |
||
81 | */ |
||
82 | private $usage; |
||
83 | |||
84 | /** |
||
85 | * @var int |
||
86 | */ |
||
87 | private $visibility = self::VISIBILITY_PUBLIC; |
||
88 | |||
89 | /** |
||
90 | * @var int |
||
91 | */ |
||
92 | private $state = self::STATE_LOCAL; |
||
93 | |||
94 | /** |
||
95 | * Anonymous class contained in this method |
||
96 | * |
||
97 | * @var array |
||
98 | */ |
||
99 | private $anonymousClasses = array(); |
||
100 | |||
101 | /** |
||
102 | * @var string |
||
103 | */ |
||
104 | private $namespace; |
||
105 | |||
106 | /** |
||
107 | * @param string $name |
||
108 | */ |
||
109 | public function __construct($name) |
||
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | public function getName() |
||
122 | |||
123 | /** |
||
124 | * @return \SplObjectStorage |
||
125 | */ |
||
126 | public function getArguments() |
||
130 | |||
131 | /** |
||
132 | * Attach argument |
||
133 | * |
||
134 | * @param ReflectedArgument $arg |
||
135 | * @return $this |
||
136 | */ |
||
137 | public function pushArgument(ReflectedArgument $arg) { |
||
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getContent() |
||
149 | |||
150 | /** |
||
151 | * @param string $content |
||
152 | * @return $this |
||
153 | */ |
||
154 | public function setContent($content) |
||
159 | |||
160 | /** |
||
161 | * @return array |
||
162 | */ |
||
163 | public function getTokens() |
||
167 | |||
168 | /** |
||
169 | * @param \Hal\Component\Token\TokenCollection $tokens |
||
170 | * @return self |
||
171 | */ |
||
172 | public function setTokens($tokens) |
||
177 | |||
178 | /** |
||
179 | * Get returned value |
||
180 | * |
||
181 | * @return array |
||
182 | */ |
||
183 | public function getReturns() { |
||
199 | |||
200 | /** |
||
201 | * Attach ne return information |
||
202 | * |
||
203 | * It make no sense for the moment to store any information abour return value / type. Maybe in PHP 6 ? :) |
||
204 | * |
||
205 | * @param ReflectedReturn $return |
||
206 | * @return $this |
||
207 | */ |
||
208 | public function pushReturn(ReflectedReturn $return) { |
||
212 | |||
213 | /** |
||
214 | * Get the list of calls |
||
215 | * |
||
216 | * @return array |
||
217 | */ |
||
218 | public function getCalls() { |
||
221 | |||
222 | /** |
||
223 | * @return array |
||
224 | */ |
||
225 | public function getExternalCalls() |
||
229 | |||
230 | /** |
||
231 | * @return array |
||
232 | */ |
||
233 | public function getInternalCalls() |
||
237 | |||
238 | /** |
||
239 | * Attach new call |
||
240 | * |
||
241 | * @param $varname |
||
242 | * @return self |
||
243 | */ |
||
244 | public function pushCall($varname) { |
||
253 | |||
254 | |||
255 | /** |
||
256 | * Push dependency |
||
257 | * |
||
258 | * @param $name |
||
259 | * @return self |
||
260 | */ |
||
261 | public function pushDependency($name) { |
||
265 | |||
266 | /** |
||
267 | * @return array |
||
268 | */ |
||
269 | public function getDependencies() |
||
293 | |||
294 | /** |
||
295 | * @param NameResolver $resolver |
||
296 | * @return self |
||
297 | */ |
||
298 | public function setNameResolver(NameResolver $resolver) |
||
303 | |||
304 | /** |
||
305 | * @return bool |
||
306 | */ |
||
307 | public function isSetter() { |
||
310 | |||
311 | /** |
||
312 | * @return string |
||
313 | */ |
||
314 | public function getUsage() |
||
318 | |||
319 | /** |
||
320 | * @param string $usage |
||
321 | */ |
||
322 | public function setUsage($usage) |
||
326 | |||
327 | /** |
||
328 | * @return bool |
||
329 | */ |
||
330 | public function isGetter() { |
||
333 | |||
334 | /** |
||
335 | * @return int |
||
336 | */ |
||
337 | public function getVisibility() |
||
341 | |||
342 | /** |
||
343 | * @param int $visibility |
||
344 | * @return $this |
||
345 | */ |
||
346 | public function setVisibility($visibility) |
||
351 | |||
352 | /** |
||
353 | * @return int |
||
354 | */ |
||
355 | public function getState() |
||
359 | |||
360 | /** |
||
361 | * @param int $state |
||
362 | * @return ReflectedMethod |
||
363 | */ |
||
364 | public function setState($state) |
||
369 | /** |
||
370 | * @param ReflectedAnonymousClass $class |
||
371 | * @return $this |
||
372 | */ |
||
373 | public function pushAnonymousClass(ReflectedAnonymousClass $class) { |
||
377 | |||
378 | /** |
||
379 | * @return array |
||
380 | */ |
||
381 | public function getAnonymousClasses() |
||
385 | |||
386 | /** |
||
387 | * @param string $namespace |
||
388 | * @return ReflectedMethod |
||
389 | */ |
||
390 | public function setNamespace($namespace) |
||
395 | |||
396 | /** |
||
397 | * @return string |
||
398 | */ |
||
399 | public function getNamespace() |
||
403 | |||
404 | }; |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..