1 | <?php |
||
34 | class AttributeDefinition implements DefinitionInterface |
||
35 | { |
||
36 | |||
37 | /** |
||
38 | * Default value (if any) |
||
39 | * |
||
40 | * @var mixed $defaultValue |
||
41 | */ |
||
42 | protected $defaultValue; |
||
43 | |||
44 | /** |
||
45 | * Is this attribute part of the invariant? |
||
46 | * |
||
47 | * @var boolean $inInvariant |
||
48 | */ |
||
49 | protected $inInvariant; |
||
50 | |||
51 | /** |
||
52 | * Is this attribute static? |
||
53 | * |
||
54 | * @var boolean $isStatic |
||
55 | */ |
||
56 | protected $isStatic; |
||
57 | |||
58 | /** |
||
59 | * Name of the class attribute |
||
60 | * |
||
61 | * @var string $name |
||
62 | */ |
||
63 | protected $name; |
||
64 | |||
65 | /** |
||
66 | * Line of the class attribute's definition |
||
67 | * |
||
68 | * @var string $line |
||
69 | */ |
||
70 | protected $line; |
||
71 | |||
72 | /** |
||
73 | * Name of the structure containing this attribute |
||
74 | * |
||
75 | * @var string $structureName |
||
76 | */ |
||
77 | protected $structureName; |
||
78 | |||
79 | /** |
||
80 | * Visibility of the attribute |
||
81 | * |
||
82 | * @var string $visibility |
||
83 | */ |
||
84 | protected $visibility; |
||
85 | |||
86 | /** |
||
87 | * Default constructor |
||
88 | */ |
||
89 | public function __construct() |
||
99 | |||
100 | /** |
||
101 | * Getter method for the $defaultValue property |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getDefaultValue() |
||
109 | |||
110 | /** |
||
111 | * Getter method for the $name property |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | public function getName() |
||
119 | |||
120 | /** |
||
121 | * Getter method for the $line property |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function getLine() |
||
129 | |||
130 | /** |
||
131 | * Will return a string representation of this assertion |
||
132 | * |
||
133 | * @return string |
||
134 | */ |
||
135 | public function getString() |
||
158 | |||
159 | /** |
||
160 | * Getter method for the $structureName property |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | public function getStructureName() |
||
168 | |||
169 | /** |
||
170 | * Getter method for the $visibility property |
||
171 | * |
||
172 | * @return string |
||
173 | */ |
||
174 | public function getVisibility() |
||
178 | |||
179 | /** |
||
180 | * If the attribute is mentioned in an invariant |
||
181 | * |
||
182 | * @return boolean |
||
183 | */ |
||
184 | public function inInvariant() |
||
188 | |||
189 | /** |
||
190 | * If the attribute is declared static |
||
191 | * |
||
192 | * @return boolean |
||
193 | */ |
||
194 | public function isStatic() |
||
198 | |||
199 | /** |
||
200 | * Setter method for the $defaultValue property |
||
201 | * |
||
202 | * @param mixed $defaultValue Default value of the attribute |
||
203 | * |
||
204 | * @return null |
||
205 | */ |
||
206 | public function setDefaultValue($defaultValue) |
||
210 | |||
211 | /** |
||
212 | * Setter method for the $inInvariant property |
||
213 | * |
||
214 | * @param boolean $inInvariant If the attribute is mentioned in an invariant clause |
||
215 | * |
||
216 | * @return null |
||
217 | */ |
||
218 | public function setInInvariant($inInvariant) |
||
222 | |||
223 | /** |
||
224 | * Setter method for the $isStatic property |
||
225 | * |
||
226 | * @param boolean $isStatic If the attribute is declared static |
||
227 | * |
||
228 | * @return null |
||
229 | */ |
||
230 | public function setIsStatic($isStatic) |
||
234 | |||
235 | /** |
||
236 | * Setter method for the $name property |
||
237 | * |
||
238 | * @param string $name Name of the attribute |
||
239 | * |
||
240 | * @return null |
||
241 | */ |
||
242 | public function setName($name) |
||
246 | |||
247 | /** |
||
248 | * Setter method for the $line property |
||
249 | * |
||
250 | * @param string $line Line of the attribute's definition |
||
251 | * |
||
252 | * @return null |
||
253 | */ |
||
254 | public function setLine($line) |
||
258 | |||
259 | /** |
||
260 | * Setter method for the $structureName property |
||
261 | * |
||
262 | * @param string $structureName Name of the containing structure |
||
263 | * |
||
264 | * @return null |
||
265 | */ |
||
266 | public function setStructureName($structureName) |
||
270 | |||
271 | /** |
||
272 | * Setter method for the $visibility property |
||
273 | * |
||
274 | * @param string $visibility Visibility of the attribute |
||
275 | * |
||
276 | * @return null |
||
277 | */ |
||
278 | public function setVisibility($visibility) |
||
282 | } |
||
283 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.