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 getDeclaringClass()
52: {
53: return ($ref = parent::getDeclaringClass()) ? new ClassReflection($ref->getName()) : NULL;
54: }
55:
56:
57:
58: 59: 60:
61: public function getDeclaringFunction()
62: {
63: return is_array($this->function) ? new MethodReflection($this->function[0], $this->function[1]) : new FunctionReflection($this->function);
64: }
65:
66:
67:
68:
69:
70:
71:
72: 73: 74:
75: public static function getReflection()
76: {
77: return new Nette\Reflection\ClassReflection(get_called_class());
78: }
79:
80:
81:
82: public function __call($name, $args)
83: {
84: return ObjectMixin::call($this, $name, $args);
85: }
86:
87:
88:
89: public function &__get($name)
90: {
91: return ObjectMixin::get($this, $name);
92: }
93:
94:
95:
96: public function __set($name, $value)
97: {
98: return ObjectMixin::set($this, $name, $value);
99: }
100:
101:
102:
103: public function __isset($name)
104: {
105: return ObjectMixin::has($this, $name);
106: }
107:
108:
109:
110: public function __unset($name)
111: {
112: throw new \MemberAccessException("Cannot unset the property {$this->reflection->name}::\$$name.");
113: }
114:
115: }
116: