Cancelled
Push — master ( 9204b0...a0a16f )
by Christopher
01:41
created

xsENTITIES::isOK()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 6

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
c 0
b 0
f 0
rs 9.4285
cc 3
eloc 6
nc 3
nop 1
1
<?php
2
3
namespace AlgoWeb\xsdTypes;
4
5
/**
6
 * The type xsd:ENTITIES represents a list of ENTITY values separated by whitespace. There must be at least one ENTITY in the list. Each of the ENTITY values must match the name of an unparsed entity that has been declared in a document type definition (DTD) for the instance.
7
 *
8
 * @package AlgoWeb\xsdTypes
9
 */
10 View Code Duplication
class xsENTITIES extends xsAnySimpleType
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * Construct
14
     *
15
     * @param mixed $value
16
     */
17
    public function __construct($value)
18
    {
19
        parent::__construct($value);
20
        $this->setMinLengthFacet(1);
21
    }
22
23
    protected function fixValue($value)
24
    {
25
        foreach ($value as $v) {
26
            $v->fixValue($v);
27
        }
28
    }
29
30
    protected function isOK($value)
31
    {
32
        if (!is_array($value)) {
33
            throw new \InvalidArgumentException(
34
                "the provided value for " . __CLASS__ . " Must be an array of type xsIDREF "
35
            );
36
        }
37
        foreach ($value as $v) {
38
            $v->isOKInternal();
39
        }
40
    }
41
}
42