1 | <?php |
||
32 | class ReflectionCompositeFactory extends ReflectorFactory |
||
33 | { |
||
34 | const REFLECTION_OBJECT = ReflectionComposite::class; |
||
35 | |||
36 | const PROPERTIES = [ |
||
37 | 'traits' => [''], |
||
38 | 'interfaces' => [''], |
||
39 | 'Methods' => ['local'], |
||
40 | 'Properties' => ['local', 'required', 'optional', 'built'] |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * @var PHPNativeReflector |
||
45 | */ |
||
46 | protected $reflector; |
||
47 | |||
48 | /** |
||
49 | * @var ReflectionComposite |
||
50 | */ |
||
51 | protected $object; |
||
52 | |||
53 | /** |
||
54 | * @var ReflectionCompositeProviderInterface |
||
55 | */ |
||
56 | protected $provider; |
||
57 | |||
58 | /** |
||
59 | * Creates a new ReflectionCompositeFactory from the given |
||
60 | * classname |
||
61 | * |
||
62 | * @param string $classname The class to build a reflect upon |
||
63 | * @return ReflectionCompositeFactory |
||
64 | */ |
||
65 | 20 | public static function fromClassName(string $classname) |
|
73 | |||
74 | /** |
||
75 | * Constructs the Factory with the given reflector and Composite |
||
76 | * provider |
||
77 | * |
||
78 | * @param PHPNativeReflectionClass $reflect |
||
79 | * @param ReflectionCompositeProviderInterface $provider |
||
80 | */ |
||
81 | 20 | public function __construct |
|
90 | |||
91 | /** |
||
92 | * Builds the ReflectionComposite from the provided parameters |
||
93 | * |
||
94 | * @return ReflectionComposite |
||
95 | */ |
||
96 | 20 | public function build() |
|
138 | |||
139 | /** |
||
140 | * Initialise the object with fixed lists |
||
141 | */ |
||
142 | 20 | protected function initObject() |
|
157 | |||
158 | /** |
||
159 | * Resize the FixedList properties down to their size |
||
160 | */ |
||
161 | 20 | protected function resizeProperties() |
|
171 | |||
172 | /** |
||
173 | * Loops through the list methods or properties adding them to the |
||
174 | * Composite |
||
175 | * |
||
176 | * @param string $name |
||
177 | * @param bool $checkFile |
||
178 | * @param string $singular |
||
|
|||
179 | */ |
||
180 | 20 | protected function addItems |
|
222 | |||
223 | /** |
||
224 | * Adds a super class / interface / trait to this Composite |
||
225 | * |
||
226 | * @param string $group The type of superclass (parent, etc...) |
||
227 | * @param PHPNativeReflectionClass $reflect |
||
228 | * @param string $method |
||
229 | */ |
||
230 | 4 | protected function addInheritance |
|
244 | |||
245 | /** |
||
246 | * Uses a ReflectionPropertyFactory to build a ReflectionProperty |
||
247 | * |
||
248 | * @param ReflectionPropertyFactory $factory |
||
249 | * @return ReflectionProperty |
||
250 | */ |
||
251 | 20 | protected function buildProperty |
|
265 | |||
266 | /** |
||
267 | * Uses a ReflectionMethodFactory to build a ReflectionMethod |
||
268 | * |
||
269 | * @param ReflectionMethodFactory $factory |
||
270 | * @return ReflectionMethod |
||
271 | */ |
||
272 | 20 | protected function buildMethod(ReflectionMethodFactory $factory) |
|
277 | } |
||
278 | |||
279 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.