ElementRef   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
c 0
b 0
f 0
dl 0
loc 26
ccs 8
cts 10
cp 0.8
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A __construct() 0 4 1
A getReferencedElement() 0 3 1
A getType() 0 3 1
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 74
    public function __construct(ElementDef $element)
17
    {
18 74
        parent::__construct($element->getSchema(), $element->getName());
19 74
        $this->wrapped = $element;
20 74
    }
21
22 1
    public function getName(): string
23
    {
24 1
        return $this->wrapped->getName();
25
    }
26
27 1
    public function getReferencedElement(): ElementDef
28
    {
29 1
        return $this->wrapped;
30
    }
31
32
    public function getType(): ?Type
33
    {
34
        return $this->wrapped->getType();
35
    }
36
}
37