Code Duplication    Length = 10-10 lines in 5 locations

src/Charcoal/Property/LangProperty.php 1 location

@@ 172-181 (lines=10) @@
169
        }
170
171
        /** Parse multilingual values */
172
        if ($this['l10n']) {
173
            $propertyValue = $this->l10nVal($val, $options);
174
            if ($propertyValue === null) {
175
                return '';
176
            }
177
        } elseif ($val instanceof Translation) {
178
            $propertyValue = (string)$val;
179
        } else {
180
            $propertyValue = $val;
181
        }
182
183
        /** Parse multiple values / ensure they are of array type. */
184
        if ($this['multiple']) {

src/Charcoal/Property/StringProperty.php 1 location

@@ 84-93 (lines=10) @@
81
        }
82
83
        /** Parse multilingual values */
84
        if ($this['l10n']) {
85
            $propertyValue = $this->l10nVal($val, $options);
86
            if ($propertyValue === null) {
87
                return '';
88
            }
89
        } elseif ($val instanceof Translation) {
90
            $propertyValue = strval($val);
91
        } else {
92
            $propertyValue = $val;
93
        }
94
95
        /** Parse multiple values / ensure they are of array type. */
96
        if ($this['multiple']) {

src/Charcoal/Property/ObjectProperty.php 1 location

@@ 344-353 (lines=10) @@
341
        }
342
343
        /** Parse multilingual values */
344
        if ($this['l10n']) {
345
            $propertyValue = $this->l10nVal($val, $options);
346
            if ($propertyValue === null) {
347
                return '';
348
            }
349
        } elseif ($val instanceof Translation) {
350
            $propertyValue = (string)$val;
351
        } else {
352
            $propertyValue = $val;
353
        }
354
355
        /** Parse multiple values / ensure they are of array type. */
356
        if ($this['multiple']) {

src/Charcoal/Property/AbstractProperty.php 2 locations

@@ 395-404 (lines=10) @@
392
        }
393
394
        /** Parse multilingual values */
395
        if ($this['l10n']) {
396
            $propertyValue = $this->l10nVal($val, $options);
397
            if ($propertyValue === null) {
398
                return '';
399
            }
400
        } elseif ($val instanceof Translation) {
401
            $propertyValue = (string)$val;
402
        } else {
403
            $propertyValue = $val;
404
        }
405
406
        /** Parse multiple values / ensure they are of array type. */
407
        if ($this['multiple']) {
@@ 432-441 (lines=10) @@
429
        }
430
431
        /** Parse multilingual values */
432
        if ($this['l10n']) {
433
            $propertyValue = $this->l10nVal($val, $options);
434
            if ($propertyValue === null) {
435
                return '';
436
            }
437
        } elseif ($val instanceof Translation) {
438
            $propertyValue = (string)$val;
439
        } else {
440
            $propertyValue = $val;
441
        }
442
443
        /** Parse multiple values / ensure they are of array type. */
444
        if ($this['multiple']) {