ElementReferenceBuilderImpl::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 7
rs 10
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