1 | <?php |
||
17 | class ReflectionUtility |
||
18 | { |
||
19 | /** |
||
20 | * Check if the given class is instantiable. |
||
21 | * |
||
22 | * @param string $className |
||
23 | */ |
||
24 | public static function isInstantiable($className): bool |
||
30 | |||
31 | /** |
||
32 | * Get the name of the parent class. |
||
33 | * |
||
34 | * @param string $className |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | public static function getParentClassName($className) |
||
44 | |||
45 | /** |
||
46 | * Check if the first class is found in the Hierarchy of the second. |
||
47 | */ |
||
48 | public static function isClassInOtherClassHierarchy(string $searchClass, string $checkedClass): bool |
||
72 | |||
73 | /** |
||
74 | * Get first class tag information. |
||
75 | * The trimmed value if the tag exists and FALSE if the tag do not exists. |
||
76 | * |
||
77 | * @return string|bool |
||
78 | */ |
||
79 | public static function getFirstTagValue(string $className, string $tag) |
||
92 | |||
93 | /** |
||
94 | * Get the tag configuration from this method and respect multiple line and space configuration. |
||
95 | * |
||
96 | * @param string $className |
||
97 | * @param $methodName |
||
98 | */ |
||
99 | public static function getTagConfigurationForMethod($className, $methodName, array $tagNames): array |
||
119 | |||
120 | /** |
||
121 | * Get the tag configuration from this method and respect multiple line and space configuration. |
||
122 | */ |
||
123 | public static function getTagConfigurationForClass(string $className, array $tagNames): array |
||
148 | |||
149 | /** |
||
150 | * Get the tag configuration from this method and respect multiple line and space configuration. |
||
151 | */ |
||
152 | public static function getTagConfigurationForProperty(string $className, string $property, array $tagNames): array |
||
172 | |||
173 | /** |
||
174 | * Get the tag value |
||
175 | * - Array (if the tag exist) |
||
176 | * - false (if the tag do not exists). |
||
177 | * |
||
178 | * @return array|bool |
||
179 | */ |
||
180 | public static function getClassTagValues(string $className, string $tag) |
||
196 | |||
197 | /** |
||
198 | * Get method tag values |
||
199 | * - Array |
||
200 | * - False (if there are any problems). |
||
201 | * |
||
202 | * @return array|bool |
||
203 | */ |
||
204 | public static function getMethodTagValues(string $className, string $methodName) |
||
215 | |||
216 | /** |
||
217 | * Get public method names. |
||
218 | */ |
||
219 | public static function getPropertyNames(string $className): array |
||
226 | |||
227 | /** |
||
228 | * @throws \ReflectionException |
||
229 | */ |
||
230 | public static function getPropertiesTaggedWith(string $className, string $tag): array |
||
244 | |||
245 | /** |
||
246 | * Get properties of the given class, that are als declared in the given class. |
||
247 | * |
||
248 | * @return array |
||
249 | */ |
||
250 | public static function getDeclaringProperties(string $className) |
||
261 | |||
262 | /** |
||
263 | * Check if the method is tagged with the given tag (no value checked). |
||
264 | * |
||
265 | * @param string $className |
||
266 | * @param string $methodName |
||
267 | * @param string $tagName |
||
268 | */ |
||
269 | public static function isMethodTaggedWith($className, $methodName, $tagName): bool |
||
275 | |||
276 | /** |
||
277 | * Check if the property is tagged with the given tag (no value checked). |
||
278 | * |
||
279 | * @param string $className |
||
280 | * @param string $propertyName |
||
281 | * @param string $tagName |
||
282 | */ |
||
283 | public static function isPropertyTaggedWith($className, $propertyName, $tagName): bool |
||
289 | } |
||
290 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.