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 |
||
71 | |||
72 | /** |
||
73 | * Get first class tag information. |
||
74 | * The trimmed value if the tag exists and FALSE if the tag do not exists. |
||
75 | * |
||
76 | * @return string|bool |
||
77 | */ |
||
78 | 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 |
||
120 | |||
121 | /** |
||
122 | * Get the tag configuration from this method and respect multiple line and space configuration. |
||
123 | */ |
||
124 | public static function getTagConfigurationForClass(string $className, array $tagNames): array |
||
145 | |||
146 | /** |
||
147 | * Get the tag configuration from this method and respect multiple line and space configuration. |
||
148 | */ |
||
149 | public static function getTagConfigurationForProperty(string $className, string $property, array $tagNames): array |
||
168 | |||
169 | /** |
||
170 | * Get public method names. |
||
171 | */ |
||
172 | public static function getPropertyNames(string $className): array |
||
178 | |||
179 | /** |
||
180 | * @throws \ReflectionException |
||
181 | */ |
||
182 | public static function getPropertiesTaggedWith(string $className, string $tag): array |
||
196 | |||
197 | /** |
||
198 | * Get public method names. |
||
199 | */ |
||
200 | public static function getPublicMethodNames(string $className): array |
||
215 | |||
216 | /** |
||
217 | * Get properties of the given class, that are als declared in the given class. |
||
218 | * |
||
219 | * @return array |
||
220 | */ |
||
221 | public static function getDeclaringProperties(string $className) |
||
232 | |||
233 | /** |
||
234 | * Check if the method is tagged with the given tag (no value checked). |
||
235 | * |
||
236 | * @param string $className |
||
237 | * @param string $methodName |
||
238 | * @param string $tagName |
||
239 | */ |
||
240 | public static function isMethodTaggedWith($className, $methodName, $tagName): bool |
||
247 | |||
248 | /** |
||
249 | * Check if the property is tagged with the given tag (no value checked). |
||
250 | * |
||
251 | * @param string $className |
||
252 | * @param string $propertyName |
||
253 | * @param string $tagName |
||
254 | */ |
||
255 | public static function isPropertyTaggedWith($className, $propertyName, $tagName): bool |
||
261 | |||
262 | /** |
||
263 | * Create reflection service. |
||
264 | * |
||
265 | * @return ReflectionService |
||
266 | */ |
||
267 | protected static function getReflectionService() |
||
273 | } |
||
274 |