1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13:
14:
15: 16: 17: 18: 19:
20: class NFunctionReflection extends ReflectionFunction
21: {
22:
23: private $value;
24:
25:
26: public function __construct($name)
27: {
28: parent::__construct($this->value = $name);
29: }
30:
31:
32:
33: public function __toString()
34: {
35: return 'Function ' . $this->getName() . '()';
36: }
37:
38:
39:
40: public function getClosure()
41: {
42: return $this->isClosure() ? $this->value : NULL;
43: }
44:
45:
46:
47:
48:
49:
50:
51: 52: 53:
54: public function getExtension()
55: {
56: return ($name = $this->getExtensionName()) ? new NExtensionReflection($name) : NULL;
57: }
58:
59:
60:
61: public function getParameters()
62: {
63: foreach ($res = parent::getParameters() as $key => $val) {
64: $res[$key] = new NParameterReflection($this->value, $val->getName());
65: }
66: return $res;
67: }
68:
69:
70:
71:
72:
73:
74:
75: 76: 77:
78: public function getReflection()
79: {
80: return new NClassReflection($this);
81: }
82:
83:
84:
85: public function __call($name, $args)
86: {
87: return NObjectMixin::call($this, $name, $args);
88: }
89:
90:
91:
92: public function &__get($name)
93: {
94: return NObjectMixin::get($this, $name);
95: }
96:
97:
98:
99: public function __set($name, $value)
100: {
101: return NObjectMixin::set($this, $name, $value);
102: }
103:
104:
105:
106: public function __isset($name)
107: {
108: return NObjectMixin::has($this, $name);
109: }
110:
111:
112:
113: public function __unset($name)
114: {
115: NObjectMixin::remove($this, $name);
116: }
117:
118: }
119: