1 | <?php |
||
14 | class InterfaceDefinition extends ParentDefinition |
||
15 | { |
||
16 | /** |
||
17 | * Class methods |
||
18 | * |
||
19 | * @var ClassMethod[] |
||
20 | */ |
||
21 | protected $methods = []; |
||
22 | |||
23 | /** |
||
24 | * Class constants |
||
25 | * |
||
26 | * @var Node\Stmt\Const_[] |
||
27 | */ |
||
28 | protected $constants = []; |
||
29 | |||
30 | /** |
||
31 | * @todo Use Finder |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $filepath; |
||
36 | |||
37 | /** |
||
38 | * @var Node\Stmt\Interface_|null |
||
39 | */ |
||
40 | protected $statement; |
||
41 | |||
42 | /** |
||
43 | * @var string[] |
||
44 | */ |
||
45 | protected $extendsInterfaces = []; |
||
46 | |||
47 | /** |
||
48 | * @var InterfaceDefinition[] |
||
49 | */ |
||
50 | protected $extendsInterfacesDefinitions; |
||
|
|||
51 | |||
52 | /** |
||
53 | * @param string $name |
||
54 | * @param Node\Stmt\Interface_ $statement |
||
55 | */ |
||
56 | public function __construct($name, Node\Stmt\Interface_ $statement = null) |
||
61 | |||
62 | /** |
||
63 | * @param ClassMethod $methodDefintion |
||
64 | */ |
||
65 | public function addMethod(ClassMethod $methodDefintion) |
||
69 | |||
70 | /** |
||
71 | * @param Node\Stmt\ClassConst $const |
||
72 | */ |
||
73 | public function addConst(Node\Stmt\ClassConst $const) |
||
77 | |||
78 | /** |
||
79 | * @param Context $context |
||
80 | * @return $this |
||
81 | */ |
||
82 | public function compile(Context $context) |
||
120 | |||
121 | /** |
||
122 | * @return bool |
||
123 | */ |
||
124 | public function isAbstract() |
||
128 | |||
129 | /** |
||
130 | * @param string $name |
||
131 | * @param boolean|false $inherit |
||
132 | * @return bool |
||
133 | */ |
||
134 | public function hasMethod($name, $inherit = false) |
||
153 | |||
154 | /** |
||
155 | * @param string $name |
||
156 | * @param bool $inherit |
||
157 | * @return bool |
||
158 | */ |
||
159 | public function hasConst($name, $inherit = false) |
||
175 | |||
176 | /** |
||
177 | * @param string $name |
||
178 | * @param boolean|false $inherit |
||
179 | * @return ClassMethod|null |
||
180 | */ |
||
181 | public function getMethod($name, $inherit = false) |
||
197 | |||
198 | /** |
||
199 | * @return string |
||
200 | */ |
||
201 | public function getFilepath() |
||
205 | |||
206 | /** |
||
207 | * @param string $filepath |
||
208 | */ |
||
209 | public function setFilepath($filepath) |
||
213 | |||
214 | /** |
||
215 | * @return string[] |
||
216 | */ |
||
217 | public function getExtendsInterface() |
||
221 | |||
222 | /** |
||
223 | * @param string $interfaceName |
||
224 | */ |
||
225 | public function addExtendsInterface($interfaceName) |
||
229 | |||
230 | /** |
||
231 | * @param InterfaceDefinition $interfaceDefinition |
||
232 | */ |
||
233 | public function addExtendsInterfaceDefinition(InterfaceDefinition $interfaceDefinition) |
||
237 | } |
||
238 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.