1 | <?php declare(strict_types = 1); |
||
13 | class MethodGenerator extends FunctionGenerator |
||
14 | { |
||
15 | /** @var bool Flag that method is static */ |
||
16 | protected $isStatic = false; |
||
17 | |||
18 | /** @var bool Flag that method is abstract */ |
||
19 | protected $isAbstract = false; |
||
20 | |||
21 | /** @var bool Flag that method is final */ |
||
22 | protected $isFinal = false; |
||
23 | |||
24 | /** @var string Method visibility */ |
||
25 | protected $visibility = ClassGenerator::VISIBILITY_PUBLIC; |
||
26 | |||
27 | /** |
||
28 | * Set method to be static. |
||
29 | * |
||
30 | * @return MethodGenerator |
||
31 | */ |
||
32 | public function defStatic() : MethodGenerator |
||
38 | |||
39 | /** |
||
40 | * Set method to be final. |
||
41 | * |
||
42 | * @return MethodGenerator |
||
43 | */ |
||
44 | public function defFinal() : MethodGenerator |
||
54 | |||
55 | /** |
||
56 | * Set method to be abstract. |
||
57 | * |
||
58 | * @return MethodGenerator |
||
59 | */ |
||
60 | public function defAbstract() : MethodGenerator |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function defLine(string $code) : AbstractGenerator |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function code(int $indentation = 0) : string |
||
94 | |||
95 | /** |
||
96 | * Build function definition. |
||
97 | * |
||
98 | * @return string Function definition |
||
99 | */ |
||
100 | protected function buildDefinition() |
||
108 | } |
||
109 |