Passed
Push — php-7.1 ( b6da63...280be0 )
by SignpostMarv
01:58
created

BaseComplexType::addAttributeFromAttributeOrRef()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
c 0
b 0
f 0
nc 1
nop 4
dl 0
loc 14
ccs 7
cts 7
cp 1
crap 1
rs 9.4285
1
<?php
2
declare(strict_types = 1);
3
namespace GoetasWebservices\XML\XSDReader\Schema\Type;
4
5
use DOMElement;
6
use GoetasWebservices\XML\XSDReader\SchemaReader;
7
use GoetasWebservices\XML\XSDReader\Schema\Inheritance\Extension;
8
use GoetasWebservices\XML\XSDReader\Schema\Inheritance\Restriction;
9
use GoetasWebservices\XML\XSDReader\Schema\Attribute\Attribute;
10
use GoetasWebservices\XML\XSDReader\Schema\Attribute\AttributeItem;
11
use GoetasWebservices\XML\XSDReader\Schema\Attribute\AttributeContainer;
12
use GoetasWebservices\XML\XSDReader\Schema\Attribute\AttributeContainerTrait;
13
use GoetasWebservices\XML\XSDReader\Schema\Schema;
14
15
abstract class BaseComplexType extends Type implements AttributeContainer
16
{
17
    use AttributeContainerTrait;
18
19 45
    public function addAttributeFromAttributeOrRef(
20
        SchemaReader $reader,
21
        DOMElement $childNode,
22
        Schema $schema,
23
        DOMElement $node
24
    ) : void {
25 45
        $attribute = Attribute::getAttributeFromAttributeOrRef(
26 45
            $reader,
27 45
            $childNode,
28 45
            $schema,
29 45
            $node
30
        );
31
32 45
        $this->addAttribute($attribute);
33 45
    }
34
}
35