Completed
Push — php-7.1 ( d2218e...926e65 )
by SignpostMarv
08:16
created

ElementRef::loadElementRef()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3.7085

Importance

Changes 0
Metric Value
cc 3
eloc 9
nc 4
nop 2
dl 0
loc 17
ccs 4
cts 7
cp 0.5714
crap 3.7085
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GoetasWebservices\XML\XSDReader\Schema\Element;
6
7
use GoetasWebservices\XML\XSDReader\Schema\Type\Type;
8
9
class ElementRef extends AbstractElementSingle
10
{
11
    /**
12
     * @var ElementDef
13
     */
14
    protected $wrapped;
15
16
    public function __construct(ElementDef $element)
17
    {
18
        parent::__construct($element->getSchema(), $element->getName());
19
        $this->wrapped = $element;
20
    }
21
22
    public function getReferencedElement(): ElementDef
23
    {
24
        return $this->wrapped;
25
    }
26
27
    public function getType(): ? Type
28
    {
29
        return $this->wrapped->getType();
30
    }
31
}
32