1 | <?php |
||
26 | final class Method implements Element |
||
|
|||
27 | { |
||
28 | /** |
||
29 | * @var DocBlock|null documentation of this method. |
||
30 | */ |
||
31 | private $docBlock = null; |
||
32 | |||
33 | /** |
||
34 | * @var Fqsen Full Qualified Structural Element Name |
||
35 | */ |
||
36 | private $fqsen; |
||
37 | |||
38 | /** @var bool $abstract */ |
||
39 | private $abstract = false; |
||
40 | |||
41 | /** @var bool $final */ |
||
42 | private $final = false; |
||
43 | |||
44 | /** @var bool $static */ |
||
45 | private $static = false; |
||
46 | |||
47 | /** @var Visibility visibility of this method */ |
||
48 | private $visibility = null; |
||
49 | |||
50 | /** @var Argument[] */ |
||
51 | private $arguments = array(); |
||
52 | |||
53 | /** |
||
54 | * @var Location |
||
55 | */ |
||
56 | private $location; |
||
57 | /** |
||
58 | * @var Type |
||
59 | */ |
||
60 | private $returnType; |
||
61 | |||
62 | /** |
||
63 | * Initializes the all properties. |
||
64 | * |
||
65 | * @param Fqsen $fqsen |
||
66 | * @param Visibility|null $visibility when null is provided a default 'public' is set. |
||
67 | * @param DocBlock|null $docBlock |
||
68 | * @param bool $abstract |
||
69 | * @param bool $static |
||
70 | * @param bool $final |
||
71 | * @param Location|null $location |
||
72 | * @param Type $returnType |
||
73 | */ |
||
74 | 9 | public function __construct( |
|
106 | |||
107 | /** |
||
108 | * Returns true when this method is abstract. Otherwise returns false. |
||
109 | * |
||
110 | * @return bool |
||
111 | */ |
||
112 | 1 | public function isAbstract() |
|
116 | |||
117 | /** |
||
118 | * Returns true when this method is final. Otherwise returns false. |
||
119 | * |
||
120 | * @return bool |
||
121 | */ |
||
122 | 1 | public function isFinal() |
|
126 | |||
127 | /** |
||
128 | * Returns true when this method is static. Otherwise returns false. |
||
129 | * |
||
130 | * @return bool |
||
131 | */ |
||
132 | 1 | public function isStatic() |
|
136 | |||
137 | /** |
||
138 | * Returns the Visibility of this method. |
||
139 | * |
||
140 | * @return Visibility |
||
141 | */ |
||
142 | 2 | public function getVisibility() |
|
146 | |||
147 | /** |
||
148 | * Returns the arguments of this method. |
||
149 | * |
||
150 | * @return Argument[] |
||
151 | */ |
||
152 | 1 | public function getArguments() |
|
156 | |||
157 | |||
158 | /** |
||
159 | * Add new argument to this method. |
||
160 | * |
||
161 | * @param Argument $argument |
||
162 | * @return void |
||
163 | */ |
||
164 | 1 | public function addArgument(Argument $argument) |
|
168 | |||
169 | /** |
||
170 | * Returns the Fqsen of the element. |
||
171 | * |
||
172 | * @return Fqsen |
||
173 | */ |
||
174 | 1 | public function getFqsen() |
|
178 | |||
179 | /** |
||
180 | * Returns the name of the element. |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | 1 | public function getName() |
|
188 | |||
189 | /** |
||
190 | * Returns the DocBlock of this method if available. |
||
191 | * |
||
192 | * @returns null|DocBlock |
||
193 | */ |
||
194 | 1 | public function getDocBlock() |
|
198 | |||
199 | /** |
||
200 | * @return Location |
||
201 | */ |
||
202 | public function getLocation() |
||
206 | |||
207 | /** |
||
208 | * Returns the in code defined return type. |
||
209 | * |
||
210 | * Return types are introduced in php 7.0 when your could doesn't have a |
||
211 | * return type defined this method will return Mixed_ by default. The return value of this |
||
212 | * method is not affected by the return tag in your docblock. |
||
213 | * |
||
214 | * @return Type |
||
215 | */ |
||
216 | 2 | public function getReturnType() |
|
220 | } |
||
221 |