EntityDefinition   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefinition() 0 3 1
A eventName() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiSkeletons\Doctrine\ORM\GraphQL\Event;
6
7
use ArrayObject;
8
use League\Event\HasEventName;
9
10
/**
11
 * This event is fired each time an entity GraphQL type is created
12
 */
13
class EntityDefinition implements
14
    HasEventName
15
{
16
    /** @param ArrayObject $definition<'description'|'fields'|'name'|'resolveField', mixed> */
17
    public function __construct(
18
        protected readonly ArrayObject $definition,
19
        protected readonly string $eventName,
20
    ) {
21
    }
22
23
    public function eventName(): string
24
    {
25
        return $this->eventName;
26
    }
27
28
    public function getDefinition(): ArrayObject
29
    {
30
        return $this->definition;
31
    }
32
}
33