xsIDREFS::isOK()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

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