1 | <?php declare(strict_types = 1); |
||
13 | class PropertyGenerator extends AbstractGenerator |
||
14 | { |
||
15 | /** @var string Property name */ |
||
16 | protected $name; |
||
17 | |||
18 | /** @var bool Flag that method is static */ |
||
19 | protected $isStatic = false; |
||
20 | |||
21 | /** @var string Method visibility */ |
||
22 | protected $visibility = ClassGenerator::VISIBILITY_PUBLIC; |
||
23 | |||
24 | /** |
||
25 | * PropertyGenerator constructor. |
||
26 | * |
||
27 | * @param string $name Property name |
||
28 | * @param AbstractGenerator|null $parent Parent generator |
||
29 | */ |
||
30 | public function __construct(string $name, AbstractGenerator $parent = null) |
||
36 | |||
37 | /** |
||
38 | * Set property visibility. |
||
39 | * |
||
40 | * @param string $visibility Property visibility |
||
41 | * |
||
42 | * @return PropertyGenerator |
||
43 | */ |
||
44 | public function defVisibility(string $visibility) : PropertyGenerator |
||
50 | |||
51 | /** |
||
52 | * Set protected property visibility. |
||
53 | * |
||
54 | * @return PropertyGenerator |
||
55 | */ |
||
56 | public function defProtected() : PropertyGenerator |
||
60 | |||
61 | /** |
||
62 | * Set private property visibility. |
||
63 | * |
||
64 | * @return PropertyGenerator |
||
65 | */ |
||
66 | public function defPrivate() : PropertyGenerator |
||
70 | |||
71 | /** |
||
72 | * Set method to be static. |
||
73 | * |
||
74 | * @return PropertyGenerator |
||
75 | */ |
||
76 | public function defStatic() : PropertyGenerator |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function code($indentation = 0) : string |
||
98 | } |
||
99 |