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

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