ElementReferenceBuilderImpl   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A build() 0 3 1
1
<?php
2
3
namespace Xml\Impl\Type\Reference;
4
5
use Xml\Impl\Type\Child\ChildElementImpl;
6
use Xml\Type\Reference\{
7
    ElementReferenceInterface,
8
    ElementReferenceBuilderInterface
9
};
10
11
class ElementReferenceBuilderImpl extends ElementReferenceCollectionBuilderImpl implements ElementReferenceBuilderInterface
12
{
13
    public function __construct(
14
        string $childElementType,
15
        string $referenceTargetClass,
16
        ChildElementImpl $child
17
    ) {
18
        parent::__construct($childElementType, $referenceTargetClass, $child);
19
        $this->elementReferenceCollectionImpl = new ElementReferenceImpl($child);
20
    }
21
22
    public function build(): ElementReferenceInterface
23
    {
24
        return $this->elementReferenceCollectionImpl;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->elementReferenceCollectionImpl returns the type Xml\Impl\Type\Reference\...ReferenceCollectionImpl which is incompatible with the type-hinted return Xml\Type\Reference\ElementReferenceInterface.
Loading history...
25
    }
26
}
27