1 | <?php declare(strict_types = 1); |
||
13 | class ClassGenerator extends GenericGenerator |
||
14 | { |
||
15 | /** OOP public visibility */ |
||
16 | const VISIBILITY_PUBLIC = 'public'; |
||
17 | |||
18 | /** OOP protected visibility */ |
||
19 | const VISIBILITY_PROTECTED = 'protected'; |
||
20 | |||
21 | /** OOP private visibility */ |
||
22 | const VISIBILITY_PRIVATE = 'private'; |
||
23 | |||
24 | /** @var string Class name */ |
||
25 | protected $className; |
||
26 | |||
27 | /** @var string Class namespace */ |
||
28 | protected $namespace; |
||
29 | |||
30 | /** @var array Collection of class uses */ |
||
31 | protected $uses; |
||
32 | |||
33 | /** @var array Multiline class comment */ |
||
34 | protected $classComment; |
||
35 | |||
36 | /** @var array Multiline file description */ |
||
37 | protected $fileDescription; |
||
38 | |||
39 | /** @var array Class constants */ |
||
40 | protected $constants; |
||
41 | |||
42 | /** @var array Class static properties */ |
||
43 | protected $staticProperties; |
||
44 | |||
45 | /** @var array Class static methods */ |
||
46 | protected $staticMethods; |
||
47 | |||
48 | /** @var array Class properties */ |
||
49 | protected $properties; |
||
50 | |||
51 | /** @var array Class methods */ |
||
52 | protected $methods; |
||
53 | |||
54 | /** @var bool Flag that class is abstract */ |
||
55 | protected $isAbstract; |
||
56 | |||
57 | /** @var bool Flag that class is final */ |
||
58 | protected $isFinal; |
||
59 | |||
60 | /** |
||
61 | * ClassGenerator constructor. |
||
62 | * |
||
63 | * @param GenericGenerator $parent Parent generator |
||
64 | * @param string $className Class name |
||
65 | */ |
||
66 | public function __construct(GenericGenerator $parent, string $className) |
||
72 | |||
73 | /** |
||
74 | * Set class to be final. |
||
75 | * |
||
76 | * @return ClassGenerator |
||
77 | */ |
||
78 | public function defFinal() : ClassGenerator |
||
88 | |||
89 | /** |
||
90 | * Set class to be abstract. |
||
91 | * |
||
92 | * @return ClassGenerator |
||
93 | */ |
||
94 | public function defAbstract() : ClassGenerator |
||
104 | |||
105 | /** |
||
106 | * Set class file description. |
||
107 | * |
||
108 | * @param string $description |
||
109 | * |
||
110 | * @return ClassGenerator |
||
111 | */ |
||
112 | public function defDescription(string $description) : ClassGenerator |
||
118 | |||
119 | /** |
||
120 | * Set class namespace. |
||
121 | * |
||
122 | * @param string $namespace |
||
123 | * |
||
124 | * @return ClassGenerator |
||
125 | */ |
||
126 | public function defNamespace(string $namespace) : ClassGenerator |
||
132 | |||
133 | /** |
||
134 | * Set class use. |
||
135 | * |
||
136 | * @param string $use |
||
137 | * |
||
138 | * @return ClassGenerator |
||
139 | */ |
||
140 | public function defUse(string $use) : ClassGenerator |
||
146 | |||
147 | /** |
||
148 | * Set class property. |
||
149 | * |
||
150 | * @param string $name Property name |
||
151 | * @param mixed $value Property value |
||
152 | * @param array $comment Property PHPDOC comment strings collection |
||
153 | * @param string $visibility Property visibility |
||
154 | * @param bool $static Flag that property is static |
||
155 | * |
||
156 | * @return ClassGenerator |
||
157 | */ |
||
158 | public function defProperty( |
||
175 | |||
176 | /** |
||
177 | * Set protected class property. |
||
178 | * |
||
179 | * @param string $name Property name |
||
180 | * @param mixed $value Property value |
||
181 | * @param array $comment Property PHPDOC comment strings collection |
||
182 | * |
||
183 | * @return ClassGenerator |
||
184 | */ |
||
185 | public function defProtectedProperty(string $name, $value, array $comment = []) |
||
189 | |||
190 | /** |
||
191 | * Set static class property. |
||
192 | * |
||
193 | * @param string $name Property name |
||
194 | * @param mixed $value Property value |
||
195 | * @param array $comment Property PHPDOC comment strings collection |
||
196 | * @param string $visibility Property visibility |
||
197 | * |
||
198 | * @return ClassGenerator |
||
199 | */ |
||
200 | public function defStaticProperty( |
||
208 | |||
209 | /** |
||
210 | * Set protected static class property. |
||
211 | * |
||
212 | * @param string $name Property name |
||
213 | * @param mixed $value Property value |
||
214 | * @param array $comment Property PHPDOC comment strings collection |
||
215 | * |
||
216 | * @return ClassGenerator |
||
217 | */ |
||
218 | public function defProtectedStaticProperty(string $name, $value, array $comment = []) |
||
222 | } |
||
223 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..