Code Duplication    Length = 28-29 lines in 2 locations

src/xsENTITIES.php 1 location

@@ 12-39 (lines=28) @@
9
 *
10
 * @package AlgoWeb\xsdTypes
11
 */
12
class xsENTITIES extends xsAnySimpleType
13
{
14
    /**
15
     * Construct
16
     *
17
     * @param mixed $value
18
     */
19
    public function __construct($value)
20
    {
21
        parent::__construct($value);
22
        $this->setMinLengthFacet(1);
23
        if ('AlgoWeb\xsdTypes\xsENTITIES' == get_class($this)) {
24
            $this->fixValue();
25
        }
26
    }
27
28
    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

src/xsIDREFS.php 1 location

@@ 10-38 (lines=29) @@
7
 * the list. Each of the IDREF values must match an ID contained in the same XML document.
8
 * @package AlgoWeb\xsdTypes
9
 */
10
class xsIDREFS extends xsAnySimpleType
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