1: <?php
2: /**
3: * PHP Token Reflection
4: *
5: * Version 1.3.1
6: *
7: * LICENSE
8: *
9: * This source file is subject to the new BSD license that is bundled
10: * with this library in the file LICENSE.
11: *
12: * @author Ondřej Nešpor
13: * @author Jaroslav Hanslík
14: */
15:
16: namespace TokenReflection;
17:
18: /**
19: * Common reflection method interface.
20: */
21: interface IReflectionMethod extends IReflectionFunctionBase
22: {
23: /**
24: * Returns the declaring class reflection.
25: *
26: * @return \TokenReflection\IReflectionClass|null
27: */
28: public function getDeclaringClass();
29:
30: /**
31: * Returns the declaring class name.
32: *
33: * @return string|null
34: */
35: public function getDeclaringClassName();
36:
37: /**
38: * Returns method modifiers.
39: *
40: * @return integer
41: */
42: public function getModifiers();
43:
44: /**
45: * Returns if the method is abstract.
46: *
47: * @return boolean
48: */
49: public function isAbstract();
50:
51: /**
52: * Returns if the method is final.
53: *
54: * @return boolean
55: */
56: public function isFinal();
57:
58: /**
59: * Returns if the method is private.
60: *
61: * @return boolean
62: */
63: public function isPrivate();
64:
65: /**
66: * Returns if the method is protected.
67: *
68: * @return boolean
69: */
70: public function isProtected();
71:
72: /**
73: * Returns if the method is public.
74: *
75: * @return boolean
76: */
77: public function isPublic();
78:
79: /**
80: * Returns if the method is static.
81: *
82: * @return boolean
83: */
84: public function isStatic();
85:
86: /**
87: * Shortcut for isPublic(), ... methods that allows or-ed modifiers.
88: *
89: * @param integer $filter Filter
90: * @return boolean
91: */
92: public function is($filter = null);
93:
94: /**
95: * Returns if the method is a constructor.
96: *
97: * @return boolean
98: */
99: public function isConstructor();
100:
101: /**
102: * Returns if the method is a destructor.
103: *
104: * @return boolean
105: */
106: public function isDestructor();
107:
108: /**
109: * Returns the method prototype.
110: *
111: * @return \TokenReflection\IReflectionMethod
112: */
113: public function getPrototype();
114:
115: /**
116: * Calls the method on an given instance.
117: *
118: * @param object $object Class instance
119: * @param mixed $args
120: * @return mixed
121: */
122: public function invoke($object, $args);
123:
124: /**
125: * Calls the method on an given object.
126: *
127: * @param object $object Class instance
128: * @param array $args Method parameter values
129: * @return mixed
130: */
131: public function invokeArgs($object, array $args);
132:
133: /**
134: * Sets a method to be accessible or not.
135: *
136: * @param boolean $accessible If the method should be accessible.
137: */
138: public function setAccessible($accessible);
139:
140: /**
141: * Returns the function/method as closure.
142: *
143: * @param object $object Object
144: * @return \Closure
145: */
146: public function getClosure($object);
147:
148: /**
149: * Returns the original name when importing from a trait.
150: *
151: * @return string|null
152: */
153: public function getOriginalName();
154:
155: /**
156: * Returns the original method when importing from a trait.
157: *
158: * @return \TokenReflection\IReflectionMethod|null
159: */
160: public function getOriginal();
161:
162: /**
163: * Returns the original modifiers value when importing from a trait.
164: *
165: * @return integer|null
166: */
167: public function getOriginalModifiers();
168:
169: /**
170: * Returns the defining trait.
171: *
172: * @return \TokenReflection\IReflectionClass|null
173: */
174: public function getDeclaringTrait();
175:
176: /**
177: * Returns the declaring trait name.
178: *
179: * @return string|null
180: */
181: public function getDeclaringTraitName();
182: }
183: