EntityDefinition::getDefinition()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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