Issues (100)

Instance/FriendRelationshipDefinition.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Tests\TestModel\Instance;
4
5
use Xml\ModelBuilder;
6
use Xml\Impl\Instance\{
7
    ModelElementInstanceImpl,
8
    ModelTypeInstanceContext
9
};
10
use Xml\Type\ModelTypeInstanceProviderInterface;
11
use Tests\TestModel\TestModelConstants;
12
13
class FriendRelationshipDefinition extends RelationshipDefinition
14
{
15
    public function __construct(ModelTypeInstanceContext $instanceContext)
16
    {
17
        parent::__construct($instanceContext);
18
    }
19
20
    public static function registerType(ModelBuilder $modelBuilder): void
21
    {
22
        $typeBuilder = $modelBuilder->defineType(
23
            FriendRelationshipDefinition::class,
24
            TestModelConstants::TYPE_NAME_FRIEND_RELATIONSHIP_DEFINITION
25
        )
26
        ->namespaceUri(TestModelConstants::MODEL_NAMESPACE)
27
        ->extendsType(RelationshipDefinition::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

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