1 | <?php |
||
12 | class NSA |
||
13 | { |
||
14 | /** |
||
15 | * Get a property of an object. If the property is static you may provide the class name (including namespace) |
||
16 | * instead of an object. |
||
17 | * |
||
18 | * @param object|string $objectOrClass |
||
19 | * @param string $propertyName |
||
20 | * |
||
21 | * @return mixed |
||
22 | * |
||
23 | * @throws \InvalidArgumentException |
||
24 | * @throws \LogicException |
||
25 | */ |
||
26 | 25 | public static function getProperty($objectOrClass, $propertyName) |
|
30 | |||
31 | /** |
||
32 | * Set a property to an object. If the property is static you may provide the class name (including namespace) |
||
33 | * instead of an object. |
||
34 | * |
||
35 | * @param object|string $objectOrClass |
||
36 | * @param string $propertyName |
||
37 | * @param mixed $value |
||
38 | * |
||
39 | * @throws \InvalidArgumentException |
||
40 | * @throws \LogicException |
||
41 | */ |
||
42 | 9 | public static function setProperty($objectOrClass, $propertyName, $value) |
|
46 | |||
47 | /** |
||
48 | * Invoke a method on a object and get the return values. If the method is static you may provide the class |
||
49 | * name (including namespace) instead of an object. |
||
50 | * |
||
51 | * @param object|string $objectOrClass |
||
52 | * @param string $methodName |
||
53 | * @param mixed ...$params |
||
54 | * |
||
55 | * @return mixed |
||
56 | * |
||
57 | * @throws \InvalidArgumentException |
||
58 | * @throws \LogicException |
||
59 | */ |
||
60 | 16 | public static function invokeMethod() |
|
96 | |||
97 | /** |
||
98 | * Get a reflection class that has this property. |
||
99 | * |
||
100 | * @param string $class |
||
101 | * @param string $propertyName |
||
102 | * |
||
103 | * @return \ReflectionClass|null |
||
104 | * |
||
105 | * @throws \InvalidArgumentException |
||
106 | */ |
||
107 | 21 | protected static function getReflectionClassWithProperty($class, $propertyName) |
|
124 | |||
125 | /** |
||
126 | * Get an reflection property that you can access directly. |
||
127 | * |
||
128 | * @param object|string $objectOrClass |
||
129 | * @param string $propertyName |
||
130 | * |
||
131 | * @return \ReflectionProperty |
||
132 | * |
||
133 | * @throws \InvalidArgumentException |
||
134 | * @throws \LogicException if the property is not found on the object |
||
135 | */ |
||
136 | 25 | protected static function getAccessibleReflectionProperty($objectOrClass, $propertyName) |
|
161 | } |
||
162 |