1 | <?php |
||
17 | class ReflectionUtility |
||
18 | { |
||
19 | /** |
||
20 | * Create a new class reflection. Do not use the makeInstance or objectManager |
||
21 | * because the reflection API is also used in front of the caching framework. |
||
22 | * |
||
23 | * @param string $className |
||
24 | * |
||
25 | * @return ClassReflection |
||
26 | */ |
||
27 | public static function createReflectionClass($className) |
||
31 | |||
32 | /** |
||
33 | * Check if the given class is instantiable. |
||
34 | * |
||
35 | * @param string $className |
||
36 | * |
||
37 | * @return bool |
||
38 | */ |
||
39 | public static function isInstantiable($className) |
||
44 | |||
45 | /** |
||
46 | * Get the name of the parent class. |
||
47 | * |
||
48 | * @param string $className |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | public static function getParentClassName($className) |
||
58 | |||
59 | /** |
||
60 | * Get all properties that are tagged with the given tag. |
||
61 | * |
||
62 | * @param string $className |
||
63 | * @param string $tag |
||
64 | * |
||
65 | * @return array |
||
66 | */ |
||
67 | public static function getPropertiesTaggedWith($className, $tag) |
||
80 | |||
81 | /** |
||
82 | * Get all properties that are tagged with the given tag. |
||
83 | * |
||
84 | * @param string $className |
||
85 | * @param string $tag |
||
86 | * |
||
87 | * @return array |
||
88 | */ |
||
89 | public static function getPropertyNamesTaggedWith($className, $tag):array |
||
102 | |||
103 | /** |
||
104 | * Get all public methods of the given class. |
||
105 | * |
||
106 | * @param string $className |
||
107 | * |
||
108 | * @return MethodReflection[] |
||
109 | */ |
||
110 | public static function getPublicMethods($className) |
||
115 | |||
116 | /** |
||
117 | * Get first class tag information. |
||
118 | * The trimmed value if the tag exists and FALSE if the tag do not exists. |
||
119 | * |
||
120 | * @param string $className |
||
121 | * @param string $tag |
||
122 | * |
||
123 | * @return string|bool |
||
124 | */ |
||
125 | public static function getFirstTagValue(string $className, string $tag) |
||
138 | |||
139 | /** |
||
140 | * Get the tag configuration from this method and respect multiple line and space configuration. |
||
141 | * |
||
142 | * @param MethodReflection|ClassReflection $reflectionObject |
||
143 | * @param array $tagNames |
||
144 | * |
||
145 | * @return array |
||
146 | */ |
||
147 | public static function getTagConfiguration($reflectionObject, array $tagNames): array |
||
166 | |||
167 | /** |
||
168 | * Get public method names |
||
169 | * |
||
170 | * @param string $className |
||
171 | * @return array |
||
172 | */ |
||
173 | public static function getPublicMethodNames(string $className):array{ |
||
181 | |||
182 | /** |
||
183 | * Get properties of the given class, that are als declared in the given class. |
||
184 | * |
||
185 | * @param string $className |
||
186 | * |
||
187 | * @return array |
||
188 | */ |
||
189 | public static function getDeclaringProperties($className) |
||
204 | } |
||
205 |