Issues (100)

Instance/AnimalAttributeReferenceCollection.php (1 issue)

Labels
Severity
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
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