1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10:
11:
12: namespace Nette\Reflection;
13:
14: use Nette,
15: Nette\ObjectMixin,
16: Nette\Annotations;
17:
18:
19:
20: 21: 22: 23: 24:
25: class ParameterReflection extends \ReflectionParameter
26: {
27:
28: private $function;
29:
30:
31: public function __construct($function, $parameter)
32: {
33: parent::__construct($this->function = $function, $parameter);
34: }
35:
36:
37:
38: 39: 40:
41: public function getClass()
42: {
43: return ($ref = parent::getClass()) ? new ClassReflection($ref->getName()) : NULL;
44: }
45:
46:
47:
48: 49: 50:
51: public function getClassName()
52: {
53: return ($tmp = Nette\String::match($this, '#>\s+([a-z0-9_\\\\]+)#i')) ? $tmp[1] : NULL;
54: }
55:
56:
57:
58: 59: 60:
61: public function getDeclaringClass()
62: {
63: return ($ref = parent::getDeclaringClass()) ? new ClassReflection($ref->getName()) : NULL;
64: }
65:
66:
67:
68: 69: 70:
71: public function getDeclaringFunction()
72: {
73: return is_array($this->function)
74: ? new MethodReflection($this->function[0], $this->function[1])
75: : new FunctionReflection($this->function);
76: }
77:
78:
79:
80:
81:
82:
83:
84: 85: 86:
87: public static function getReflection()
88: {
89: return new ClassReflection(get_called_class());
90: }
91:
92:
93:
94: public function __call($name, $args)
95: {
96: return ObjectMixin::call($this, $name, $args);
97: }
98:
99:
100:
101: public function &__get($name)
102: {
103: return ObjectMixin::get($this, $name);
104: }
105:
106:
107:
108: public function __set($name, $value)
109: {
110: return ObjectMixin::set($this, $name, $value);
111: }
112:
113:
114:
115: public function __isset($name)
116: {
117: return ObjectMixin::has($this, $name);
118: }
119:
120:
121:
122: public function __unset($name)
123: {
124: ObjectMixin::remove($this, $name);
125: }
126:
127: }
128: