xsENTITIES::isOK()   A
last analyzed

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
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 6
nc 3
nop 0
1
<?php
2
namespace AlgoWeb\xsdTypes;
3
4
use AlgoWeb\xsdTypes\Facets\LengthTrait;
5
6
/**
7
 * The type xsd:ENTITIES represents a list of ENTITY values separated by whitespace.
8
 * There must be at least one ENTITY in the list.  Each of the ENTITY values must match the name of an unparsed entity
9
 * that has been declared in a document type definition (DTD) for the instance.
10
 *
11
 * @package AlgoWeb\xsdTypes
12
 */
13
class xsENTITIES extends xsAnySimpleType
14
{
15
    use LengthTrait;
16
17
    /**
18
     * Construct.
19
     *
20
     * @param xsENTITY $value
21
     */
22
    public function __construct($value)
23
    {
24
        parent::__construct($value);
25
        $this->setMinLengthFacet(1);
26
    }
27
28 View Code Duplication
    protected function isOK()
29
    {
30
        if (!is_array($this->value)) {
31
            throw new \InvalidArgumentException(
32
                'The provided value for ' . __CLASS__ . ' must be an array of type xsENTITY.'
33
            );
34
        }
35
        foreach ($this->value as $v) {
36
            $v->isOKInternal();
37
        }
38
    }
39
}
40