1 | <?php |
||
16 | abstract class AbstractReflection |
||
17 | { |
||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $class; |
||
22 | |||
23 | /** |
||
24 | * @var object |
||
25 | */ |
||
26 | protected $object; |
||
27 | |||
28 | /** |
||
29 | * __get. |
||
30 | * |
||
31 | * Overloading method to get any $key property from $this->class or if not |
||
32 | * static, from $this->object. |
||
33 | * |
||
34 | * @param $key |
||
35 | * @return \ReflectionProperty |
||
36 | */ |
||
37 | 2 | public function __get($key) |
|
42 | |||
43 | /** |
||
44 | * __set. |
||
45 | * |
||
46 | * Overloading method to set any $key property to $this->class or if not static, |
||
47 | * to $this->object. |
||
48 | * |
||
49 | * @param $key |
||
50 | * @param $value |
||
51 | * @return $this |
||
52 | */ |
||
53 | 2 | public function __set($key, $value) |
|
62 | |||
63 | /** |
||
64 | * __call. |
||
65 | * |
||
66 | * Overloading method to call the $name method from $this->class and if not |
||
67 | * static, using $this->object. |
||
68 | * |
||
69 | * @param $name |
||
70 | * @param $args |
||
71 | * |
||
72 | * @return \ReflectionMethod |
||
73 | */ |
||
74 | 2 | public function __call($name, $args) |
|
79 | |||
80 | /** |
||
81 | * Get Property |
||
82 | * |
||
83 | * @param $key |
||
84 | * @return \ReflectionProperty |
||
85 | */ |
||
86 | 4 | private function getProperty($key) |
|
92 | |||
93 | /** |
||
94 | * Get Method |
||
95 | * |
||
96 | * @param $key |
||
97 | * @return \ReflectionMethod |
||
98 | */ |
||
99 | 2 | private function getMethod($key) |
|
105 | } |
||
106 |