1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AlgoWeb\ODataMetadata\MetadataV3\edm\Groups; |
4
|
|
|
|
5
|
|
|
use AlgoWeb\ODataMetadata\CodeGeneration\AccessTypeTraits; |
6
|
|
|
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait; |
7
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TCollationFacetTrait; |
8
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TConcurrencyModeTrait; |
9
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TIsFixedLengthFacetTrait; |
10
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TIsUnicodeFacetTrait; |
11
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TMaxLengthFacetTrait; |
12
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TPrecisionFacetTrait; |
13
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TPropertyTypeTrait; |
14
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TScaleFacetTrait; |
15
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TSimpleIdentifierTrait; |
16
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TSridFacetTrait; |
17
|
|
|
|
18
|
|
|
trait TCommonPropertyAttributesTrait |
19
|
|
|
{ |
20
|
|
|
use TSimpleIdentifierTrait, TMaxLengthFacetTrait, TIsFixedLengthFacetTrait, TPrecisionFacetTrait, TScaleFacetTrait, |
21
|
|
|
TIsUnicodeFacetTrait, TCollationFacetTrait, TSridFacetTrait, TConcurrencyModeTrait, AccessTypeTraits, |
22
|
|
|
IsOKToolboxTrait, TPropertyTypeTrait { |
23
|
|
|
TMaxLengthFacetTrait::normaliseString insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
24
|
|
|
TMaxLengthFacetTrait::preserveString insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
25
|
|
|
TMaxLengthFacetTrait::replaceString insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
26
|
|
|
TMaxLengthFacetTrait::collapseString insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
27
|
|
|
TMaxLengthFacetTrait::token insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
28
|
|
|
TMaxLengthFacetTrait::string insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
29
|
|
|
TMaxLengthFacetTrait::integer insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
30
|
|
|
TMaxLengthFacetTrait::nonNegativeInteger insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
31
|
|
|
TMaxLengthFacetTrait::decimal insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
32
|
|
|
TMaxLengthFacetTrait::double insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
33
|
|
|
TMaxLengthFacetTrait::dateTime insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
34
|
|
|
TMaxLengthFacetTrait::hexBinary insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait; |
35
|
|
|
TSimpleIdentifierTrait::isNCName insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait, |
36
|
|
|
TMaxLengthFacetTrait, TPropertyTypeTrait; |
37
|
|
|
TSimpleIdentifierTrait::matchesRegexPattern insteadof TPrecisionFacetTrait, TScaleFacetTrait, |
38
|
|
|
TSridFacetTrait, TMaxLengthFacetTrait, TPropertyTypeTrait; |
39
|
|
|
TSimpleIdentifierTrait::isName insteadof TPrecisionFacetTrait, TScaleFacetTrait, TSridFacetTrait, |
40
|
|
|
TMaxLengthFacetTrait, TPropertyTypeTrait; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @property string $name |
45
|
|
|
*/ |
46
|
|
|
private $name = null; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @property string $type |
50
|
|
|
*/ |
51
|
|
|
private $type = null; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @property boolean $nullable |
55
|
|
|
*/ |
56
|
|
|
private $nullable = true; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @property string $defaultValue |
60
|
|
|
*/ |
61
|
|
|
private $defaultValue = null; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @property string $maxLength |
65
|
|
|
*/ |
66
|
|
|
private $maxLength = null; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @property boolean $fixedLength |
70
|
|
|
*/ |
71
|
|
|
private $fixedLength = null; |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @property integer $precision |
75
|
|
|
*/ |
76
|
|
|
private $precision = null; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @property integer $scale |
80
|
|
|
*/ |
81
|
|
|
private $scale = null; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @property boolean $unicode |
85
|
|
|
*/ |
86
|
|
|
private $unicode = null; |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @property string $collation |
90
|
|
|
*/ |
91
|
|
|
private $collation = null; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @property string $sRID |
95
|
|
|
*/ |
96
|
|
|
private $sRID = null; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @property string $concurrencyMode |
100
|
|
|
*/ |
101
|
|
|
private $concurrencyMode = null; |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @property string $setterAccess |
105
|
|
|
*/ |
106
|
|
|
private $setterAccess = null; |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @property string $getterAccess |
110
|
|
|
*/ |
111
|
|
|
private $getterAccess = null; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Gets as name |
115
|
|
|
* |
116
|
|
|
* @return string |
117
|
|
|
*/ |
118
|
|
|
public function getName() |
119
|
|
|
{ |
120
|
|
|
return $this->name; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Sets a new name |
125
|
|
|
* |
126
|
|
|
* @param string $name |
127
|
|
|
* @return self |
128
|
|
|
*/ |
129
|
|
|
public function setName($name) |
130
|
|
|
{ |
131
|
|
|
$msg = null; |
|
|
|
|
132
|
|
|
if (!$this->isTSimpleIdentifierValid($name)) { |
133
|
|
|
$msg = "Name must be a valid TSimpleIdentifier"; |
134
|
|
|
throw new \InvalidArgumentException($msg); |
135
|
|
|
} |
136
|
|
|
$this->name = $name; |
137
|
|
|
return $this; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* Gets as type |
142
|
|
|
* |
143
|
|
|
* @return string |
144
|
|
|
*/ |
145
|
|
|
public function getType() |
146
|
|
|
{ |
147
|
|
|
return $this->type; |
148
|
|
|
} |
149
|
|
|
|
150
|
|
|
/** |
151
|
|
|
* Sets a new type |
152
|
|
|
* |
153
|
|
|
* @param string $type |
154
|
|
|
* @return self |
155
|
|
|
*/ |
156
|
|
|
public function setType($type) |
157
|
|
|
{ |
158
|
|
|
$msg = null; |
|
|
|
|
159
|
|
|
if (!$this->isTPropertyTypeValid($type)) { |
160
|
|
|
$msg = "Type must be a valid TPropertyType"; |
161
|
|
|
throw new \InvalidArgumentException($msg); |
162
|
|
|
} |
163
|
|
|
$this->type = $type; |
164
|
|
|
return $this; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
/** |
168
|
|
|
* Gets as nullable |
169
|
|
|
* |
170
|
|
|
* @return boolean |
171
|
|
|
*/ |
172
|
|
|
public function getNullable() |
173
|
|
|
{ |
174
|
|
|
return $this->nullable; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* Sets a new nullable |
179
|
|
|
* |
180
|
|
|
* @param boolean $nullable |
181
|
|
|
* @return self |
182
|
|
|
*/ |
183
|
|
|
public function setNullable($nullable) |
184
|
|
|
{ |
185
|
|
|
$this->nullable = boolval($nullable); |
186
|
|
|
return $this; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* Gets as defaultValue |
191
|
|
|
* |
192
|
|
|
* @return string |
193
|
|
|
*/ |
194
|
|
|
public function getDefaultValue() |
195
|
|
|
{ |
196
|
|
|
return $this->defaultValue; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* Sets a new defaultValue |
201
|
|
|
* |
202
|
|
|
* @param string $defaultValue |
203
|
|
|
* @return self |
204
|
|
|
*/ |
205
|
|
|
public function setDefaultValue($defaultValue) |
206
|
|
|
{ |
207
|
|
|
$msg = null; |
|
|
|
|
208
|
|
|
if (is_numeric($defaultValue)) { |
209
|
|
|
$defaultValue = strval($defaultValue); |
210
|
|
|
} |
211
|
|
|
if (null !== $defaultValue && !is_string($defaultValue)) { |
212
|
|
|
$msg = "Default value must be resolvable to a string"; |
213
|
|
|
throw new \InvalidArgumentException($msg); |
214
|
|
|
} |
215
|
|
|
$this->defaultValue = $defaultValue; |
216
|
|
|
return $this; |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* Gets as maxLength |
221
|
|
|
* |
222
|
|
|
* @return string |
223
|
|
|
*/ |
224
|
|
|
public function getMaxLength() |
225
|
|
|
{ |
226
|
|
|
return $this->maxLength; |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* Sets a new maxLength |
231
|
|
|
* |
232
|
|
|
* @param string $maxLength |
233
|
|
|
* @return self |
234
|
|
|
*/ |
235
|
|
View Code Duplication |
public function setMaxLength($maxLength) |
|
|
|
|
236
|
|
|
{ |
237
|
|
|
$msg = null; |
|
|
|
|
238
|
|
|
if (null != $maxLength && !$this->isTMaxLengthFacetValid($maxLength)) { |
239
|
|
|
$msg = "Max length must be a valid TMaxLengthFacet"; |
240
|
|
|
throw new \InvalidArgumentException($msg); |
241
|
|
|
} |
242
|
|
|
$this->maxLength = $maxLength; |
243
|
|
|
return $this; |
244
|
|
|
} |
245
|
|
|
|
246
|
|
|
/** |
247
|
|
|
* Gets as fixedLength |
248
|
|
|
* |
249
|
|
|
* @return boolean |
250
|
|
|
*/ |
251
|
|
|
public function getFixedLength() |
252
|
|
|
{ |
253
|
|
|
return $this->fixedLength; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* Sets a new fixedLength |
258
|
|
|
* |
259
|
|
|
* @param boolean $fixedLength |
260
|
|
|
* @return self |
261
|
|
|
*/ |
262
|
|
|
public function setFixedLength($fixedLength) |
263
|
|
|
{ |
264
|
|
|
$this->fixedLength = boolval($fixedLength); |
265
|
|
|
return $this; |
266
|
|
|
} |
267
|
|
|
|
268
|
|
|
/** |
269
|
|
|
* Gets as precision |
270
|
|
|
* |
271
|
|
|
* @return integer |
272
|
|
|
*/ |
273
|
|
|
public function getPrecision() |
274
|
|
|
{ |
275
|
|
|
return $this->precision; |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* Sets a new precision |
280
|
|
|
* |
281
|
|
|
* @param integer $precision |
282
|
|
|
* @return self |
283
|
|
|
*/ |
284
|
|
View Code Duplication |
public function setPrecision($precision) |
|
|
|
|
285
|
|
|
{ |
286
|
|
|
$msg = null; |
|
|
|
|
287
|
|
|
if (null != $precision && !$this->isTPrecisionFacetValid($precision)) { |
288
|
|
|
$msg = "Precision must be a valid TPrecisionFacet"; |
289
|
|
|
throw new \InvalidArgumentException($msg); |
290
|
|
|
} |
291
|
|
|
$this->precision = $precision; |
292
|
|
|
return $this; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
/** |
296
|
|
|
* Gets as scale |
297
|
|
|
* |
298
|
|
|
* @return integer |
299
|
|
|
*/ |
300
|
|
|
public function getScale() |
301
|
|
|
{ |
302
|
|
|
return $this->scale; |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* Sets a new scale |
307
|
|
|
* |
308
|
|
|
* @param integer $scale |
309
|
|
|
* @return self |
310
|
|
|
*/ |
311
|
|
View Code Duplication |
public function setScale($scale) |
|
|
|
|
312
|
|
|
{ |
313
|
|
|
$msg = null; |
|
|
|
|
314
|
|
|
if (null != $scale && !$this->isTScaleFacetValid($scale)) { |
315
|
|
|
$msg = "Scale must be a valid TScaleFacet"; |
316
|
|
|
throw new \InvalidArgumentException($msg); |
317
|
|
|
} |
318
|
|
|
$this->scale = $scale; |
319
|
|
|
return $this; |
320
|
|
|
} |
321
|
|
|
|
322
|
|
|
/** |
323
|
|
|
* Gets as unicode |
324
|
|
|
* |
325
|
|
|
* @return boolean |
326
|
|
|
*/ |
327
|
|
|
public function getUnicode() |
328
|
|
|
{ |
329
|
|
|
return $this->unicode; |
330
|
|
|
} |
331
|
|
|
|
332
|
|
|
/** |
333
|
|
|
* Sets a new unicode |
334
|
|
|
* |
335
|
|
|
* @param boolean $unicode |
336
|
|
|
* @return self |
337
|
|
|
*/ |
338
|
|
View Code Duplication |
public function setUnicode($unicode) |
|
|
|
|
339
|
|
|
{ |
340
|
|
|
$msg = null; |
|
|
|
|
341
|
|
|
if (null != $unicode && !$this->isTIsUnicodeFacetTraitValid($unicode)) { |
342
|
|
|
$msg = "Unicode must be a valid TUnicodeFacet"; |
343
|
|
|
throw new \InvalidArgumentException($msg); |
344
|
|
|
} |
345
|
|
|
$this->unicode = boolval($unicode); |
346
|
|
|
return $this; |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
/** |
350
|
|
|
* Gets as collation |
351
|
|
|
* |
352
|
|
|
* @return string |
353
|
|
|
*/ |
354
|
|
|
public function getCollation() |
355
|
|
|
{ |
356
|
|
|
return $this->collation; |
357
|
|
|
} |
358
|
|
|
|
359
|
|
|
/** |
360
|
|
|
* Sets a new collation |
361
|
|
|
* |
362
|
|
|
* @param string $collation |
363
|
|
|
* @return self |
364
|
|
|
*/ |
365
|
|
|
public function setCollation($collation) |
366
|
|
|
{ |
367
|
|
|
$this->collation = $collation; |
368
|
|
|
return $this; |
369
|
|
|
} |
370
|
|
|
|
371
|
|
|
/** |
372
|
|
|
* Gets as sRID |
373
|
|
|
* |
374
|
|
|
* @return string |
375
|
|
|
*/ |
376
|
|
|
public function getSRID() |
377
|
|
|
{ |
378
|
|
|
return $this->sRID; |
379
|
|
|
} |
380
|
|
|
|
381
|
|
|
/** |
382
|
|
|
* Sets a new sRID |
383
|
|
|
* |
384
|
|
|
* @param string $sRID |
385
|
|
|
* @return self |
386
|
|
|
*/ |
387
|
|
View Code Duplication |
public function setSRID($sRID) |
|
|
|
|
388
|
|
|
{ |
389
|
|
|
$msg = null; |
|
|
|
|
390
|
|
|
if (null != $sRID && !$this->isTSridFacetValid($sRID)) { |
391
|
|
|
$msg = "SRID must be a valid TSridFacet"; |
392
|
|
|
throw new \InvalidArgumentException($msg); |
393
|
|
|
} |
394
|
|
|
$this->sRID = $sRID; |
395
|
|
|
return $this; |
396
|
|
|
} |
397
|
|
|
|
398
|
|
|
/** |
399
|
|
|
* Gets as concurrencyMode |
400
|
|
|
* |
401
|
|
|
* @return string |
402
|
|
|
*/ |
403
|
|
|
public function getConcurrencyMode() |
404
|
|
|
{ |
405
|
|
|
return $this->concurrencyMode; |
406
|
|
|
} |
407
|
|
|
|
408
|
|
|
/** |
409
|
|
|
* Sets a new concurrencyMode |
410
|
|
|
* |
411
|
|
|
* @param string $concurrencyMode |
412
|
|
|
* @return self |
413
|
|
|
*/ |
414
|
|
|
public function setConcurrencyMode($concurrencyMode) |
415
|
|
|
{ |
416
|
|
|
$msg = null; |
|
|
|
|
417
|
|
|
if (null != $concurrencyMode && !$this->isTConcurrencyModeValid($concurrencyMode)) { |
418
|
|
|
$msg = "ConcurrencyMode must be a valid TConcurrencyMode"; |
419
|
|
|
throw new \InvalidArgumentException($msg); |
420
|
|
|
} |
421
|
|
|
$this->concurrencyMode = $concurrencyMode; |
422
|
|
|
return $this; |
423
|
|
|
} |
424
|
|
|
|
425
|
|
|
/** |
426
|
|
|
* Gets as setterAccess |
427
|
|
|
* |
428
|
|
|
* @return string |
429
|
|
|
*/ |
430
|
|
|
public function getSetterAccess() |
431
|
|
|
{ |
432
|
|
|
return $this->setterAccess; |
433
|
|
|
} |
434
|
|
|
|
435
|
|
|
/** |
436
|
|
|
* Sets a new setterAccess |
437
|
|
|
* |
438
|
|
|
* @param string $setterAccess |
439
|
|
|
* @return self |
440
|
|
|
*/ |
441
|
|
View Code Duplication |
public function setSetterAccess($setterAccess) |
|
|
|
|
442
|
|
|
{ |
443
|
|
|
$msg = null; |
|
|
|
|
444
|
|
|
if (null != $setterAccess && !$this->isTAccessOk($setterAccess)) { |
445
|
|
|
$msg = "Setter access must be a valid TAccess"; |
446
|
|
|
throw new \InvalidArgumentException($msg); |
447
|
|
|
} |
448
|
|
|
$this->setterAccess = $setterAccess; |
449
|
|
|
return $this; |
450
|
|
|
} |
451
|
|
|
|
452
|
|
|
/** |
453
|
|
|
* Gets as getterAccess |
454
|
|
|
* |
455
|
|
|
* @return string |
456
|
|
|
*/ |
457
|
|
|
public function getGetterAccess() |
458
|
|
|
{ |
459
|
|
|
return $this->getterAccess; |
460
|
|
|
} |
461
|
|
|
|
462
|
|
|
/** |
463
|
|
|
* Sets a new getterAccess |
464
|
|
|
* |
465
|
|
|
* @param string $getterAccess |
466
|
|
|
* @return self |
467
|
|
|
*/ |
468
|
|
View Code Duplication |
public function setGetterAccess($getterAccess) |
|
|
|
|
469
|
|
|
{ |
470
|
|
|
$msg = null; |
|
|
|
|
471
|
|
|
if (null != $getterAccess && !$this->isTAccessOk($getterAccess)) { |
472
|
|
|
$msg = "Getter access must be a valid TAccess"; |
473
|
|
|
throw new \InvalidArgumentException($msg); |
474
|
|
|
} |
475
|
|
|
$this->getterAccess = $getterAccess; |
476
|
|
|
return $this; |
477
|
|
|
} |
478
|
|
|
|
479
|
|
|
public function isTCommonPropertyAttributesValid(&$msg = null) |
480
|
|
|
{ |
481
|
|
View Code Duplication |
if (!$this->isTSimpleIdentifierValid($this->name)) { |
|
|
|
|
482
|
|
|
$msg = "Name must be a valid TSimpleIdentifier: " . get_class($this); |
483
|
|
|
return false; |
484
|
|
|
} |
485
|
|
|
if (!$this->isTPropertyTypeValid($this->type)) { |
486
|
|
|
$msg = "Type must be a valid TPropertyType: " . get_class($this); |
487
|
|
|
return false; |
488
|
|
|
} |
489
|
|
View Code Duplication |
if (null != $this->nullable && $this->nullable !== boolval($this->nullable)) { |
|
|
|
|
490
|
|
|
$msg = "Nullable must be boolean: " . get_class($this); |
491
|
|
|
return false; |
492
|
|
|
} |
493
|
|
View Code Duplication |
if (null != $this->defaultValue && !is_string($this->defaultValue)) { |
|
|
|
|
494
|
|
|
$msg = "Default value must be a string: " . get_class($this); |
495
|
|
|
return false; |
496
|
|
|
} |
497
|
|
View Code Duplication |
if (null != $this->maxLength && !$this->isTMaxLengthFacetValid($this->maxLength)) { |
|
|
|
|
498
|
|
|
$msg = "Max length must be a valid TMaxLengthFacet: " . get_class($this); |
499
|
|
|
return false; |
500
|
|
|
} |
501
|
|
View Code Duplication |
if (null != $this->fixedLength && !$this->isTIsFixedLengthFacetTraitValid($this->fixedLength)) { |
|
|
|
|
502
|
|
|
$msg = "Max length must be a valid TFixedLengthFacet: " . get_class($this); |
503
|
|
|
return false; |
504
|
|
|
} |
505
|
|
View Code Duplication |
if (null != $this->precision && !$this->isTPrecisionFacetValid($this->precision)) { |
|
|
|
|
506
|
|
|
$msg = "Precision must be a valid TPrecisionFacet: " . get_class($this); |
507
|
|
|
return false; |
508
|
|
|
} |
509
|
|
View Code Duplication |
if (null != $this->scale && !$this->isTScaleFacetValid($this->scale)) { |
|
|
|
|
510
|
|
|
$msg = "Scale must be a valid TScaleFacet: " . get_class($this); |
511
|
|
|
return false; |
512
|
|
|
} |
513
|
|
View Code Duplication |
if (null != $this->unicode && !$this->isTIsUnicodeFacetTraitValid($this->unicode)) { |
|
|
|
|
514
|
|
|
$msg = "Unicode must be a valid TUnicodeFacet: " . get_class($this); |
515
|
|
|
return false; |
516
|
|
|
} |
517
|
|
View Code Duplication |
if (null != $this->collation && !$this->isTCollationFacetValid($this->collation)) { |
|
|
|
|
518
|
|
|
$msg = "Collation must be a valid TCollationFacet: " . get_class($this); |
519
|
|
|
return false; |
520
|
|
|
} |
521
|
|
View Code Duplication |
if (null != $this->sRID && !$this->isTSridFacetValid($this->sRID)) { |
|
|
|
|
522
|
|
|
$msg = "SRID must be a valid TSridFacet: " . get_class($this); |
523
|
|
|
return false; |
524
|
|
|
} |
525
|
|
|
if (null != $this->concurrencyMode && !$this->isTConcurrencyModeValid($this->concurrencyMode)) { |
526
|
|
|
$msg = "ConcurrencyMode must be a valid TConcurrencyMode: " . get_class($this); |
527
|
|
|
return false; |
528
|
|
|
} |
529
|
|
View Code Duplication |
if (null != $this->setterAccess && !$this->isTAccessOk($this->setterAccess)) { |
|
|
|
|
530
|
|
|
$msg = "Setter access must be a valid TAccess: " . get_class($this); |
531
|
|
|
return false; |
532
|
|
|
} |
533
|
|
View Code Duplication |
if (null != $this->getterAccess && !$this->isTAccessOk($this->getterAccess)) { |
|
|
|
|
534
|
|
|
$msg = "Getter access must be a valid TAccess: " . get_class($this); |
535
|
|
|
return false; |
536
|
|
|
} |
537
|
|
|
|
538
|
|
|
return true; |
539
|
|
|
} |
540
|
|
|
} |
541
|
|
|
|
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.