Passed
Push — master ( 4837dc...c02ffb )
by Christopher
01:39
created

xsIDREFS::fixValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace AlgoWeb\xsdTypes;
4
5
/**
6
 * The type xsd:IDREFS represents a list of IDREF values separated by whitespace. There must be at least one IDREF in
7
 * the list. Each of the IDREF values must match an ID contained in the same XML document.
8
 * @package AlgoWeb\xsdTypes
9
 */
10 View Code Duplication
class xsIDREFS 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
        if ('AlgoWeb\xsdTypes\xsIDREFS' == get_class($this)) {
22
            $this->fixValue();
23
        }
24
    }
25
26
    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