Issues (100)

tests/TestModel/Instance/Guardian.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Tests\TestModel\Instance;
4
5
use Xml\ModelBuilder;
6
use Xml\Impl\Instance\ModelTypeInstanceContext;
7
use Xml\Type\ModelTypeInstanceProviderInterface;
8
use Tests\TestModel\TestModelConstants;
9
10
class Guardian extends AnimalReference
11
{
12
    public function __construct(ModelTypeInstanceContext $instanceContext)
13
    {
14
        parent::__construct($instanceContext);
15
    }
16
17
    public static function registerType(ModelBuilder $modelBuilder): void
18
    {
19
        $typeBuilder = $modelBuilder->defineType(
20
            Guardian::class,
21
            TestModelConstants::ELEMENT_NAME_GUARDIAN
22
        )
23
        ->namespaceUri(TestModelConstants::MODEL_NAMESPACE)
24
        ->extendsType(AnimalReference::class)
0 ignored issues
show
The method extendsType() does not exist on Xml\Type\ModelElementTypeBuilderInterface. Since it exists in all sub-types, consider adding an abstract or default implementation to Xml\Type\ModelElementTypeBuilderInterface. ( Ignorable by Annotation )

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

24
        ->/** @scrutinizer ignore-call */ extendsType(AnimalReference::class)
Loading history...
25
        ->instanceProvider(
26
            new class implements ModelTypeInstanceProviderInterface
27
            {
28
                public function newInstance(ModelTypeInstanceContext $instanceContext): Guardian
29
                {
30
                    return new Guardian($instanceContext);
31
                }
32
            }
33
        );
34
35
        $typeBuilder->build();
36
    }
37
}
38