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