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 | 21 | 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 | 21 | public function __construct |
|
90 | |||
91 | /** |
||
92 | * Builds the ReflectionComposite from the provided parameters |
||
93 | * |
||
94 | * @return ReflectionComposite |
||
95 | */ |
||
96 | 21 | public function build() |
|
143 | |||
144 | /** |
||
145 | * Initialise the object with fixed lists |
||
146 | */ |
||
147 | 21 | protected function initObject() |
|
162 | |||
163 | /** |
||
164 | * Adds a generic value to this class |
||
165 | * |
||
166 | * @var string $name Should be 'generic'. Unused |
||
167 | * @var string $value The annotation value |
||
168 | */ |
||
169 | 19 | public function addGeneric($name, $value) |
|
187 | |||
188 | /** |
||
189 | * Resize the FixedList properties down to their size |
||
190 | */ |
||
191 | 21 | protected function resizeProperties() |
|
201 | |||
202 | /** |
||
203 | * Loops through the list methods or properties adding them to the |
||
204 | * Composite |
||
205 | * |
||
206 | * @param string $name |
||
207 | * @param bool $checkFile |
||
208 | * @param string $singular |
||
209 | */ |
||
210 | 21 | protected function addItems |
|
252 | |||
253 | /** |
||
254 | * Adds a super class / interface / trait to this Composite |
||
255 | * |
||
256 | * @param string $group The type of superclass (parent, etc...) |
||
257 | * @param PHPNativeReflectionClass $reflect |
||
258 | * @param string $method |
||
259 | */ |
||
260 | 3 | protected function addInheritance |
|
279 | |||
280 | /** |
||
281 | * Uses a ReflectionPropertyFactory to build a ReflectionProperty |
||
282 | * |
||
283 | * @param ReflectionPropertyFactory $factory |
||
284 | * @return ReflectionProperty |
||
285 | */ |
||
286 | 20 | protected function buildProperty |
|
300 | |||
301 | /** |
||
302 | * Uses a ReflectionMethodFactory to build a ReflectionMethod |
||
303 | * |
||
304 | * @param ReflectionMethodFactory $factory |
||
305 | * @return ReflectionMethod |
||
306 | */ |
||
307 | 21 | protected function buildMethod(ReflectionMethodFactory $factory) |
|
312 | } |
||
313 | |||
314 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.