AnimalAttributeReferenceCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 10
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTargetElementIdentifier() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Tests\TestModel\Instance;
4
5
use Xml\Instance\ModelElementInstanceInterface;
6
use Xml\Impl\Type\Attribute\AttributeImpl;
7
use Xml\Type\Reference\AttributeReferenceCollection;
8
9
class AnimalAttributeReferenceCollection extends AttributeReferenceCollection
10
{
11
    public function __construct(AttributeImpl $referenceSourceAttribute)
12
    {
13
        parent::__construct($referenceSourceAttribute);
14
    }
15
16
    protected function getTargetElementIdentifier(ModelElementInstanceInterface $referenceTargetElement): string
17
    {
18
        return $referenceTargetElement->getId();
0 ignored issues
show
Bug introduced by
The method getId() does not exist on Xml\Instance\ModelElementInstanceInterface. It seems like you code against a sub-type of Xml\Instance\ModelElementInstanceInterface such as Tests\TestModel\Instance\Animal or Tests\TestModel\Instance\Egg or Tests\TestModel\Instance\RelationshipDefinition. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        return $referenceTargetElement->/** @scrutinizer ignore-call */ getId();
Loading history...
19
    }
20
}
21