Entity   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 43
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getByValue() 0 3 1
A getGroup() 0 3 1
A __construct() 0 9 1
A getLimit() 0 3 1
A getTypeName() 0 3 1
A getDescription() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiSkeletons\Doctrine\ORM\GraphQL\Attribute;
6
7
use ApiSkeletons\Doctrine\ORM\GraphQL\Filter\Filters;
8
use Attribute;
9
10
/**
11
 * Attribute to define an entity for GraphQL
12
 */
13
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
14
final class Entity
15
{
16
    use ExcludeFilters;
17
18
    /**
19
     * @param Filters[] $excludeFilters
20
     * @param Filters[] $includeFilters
21
     */
22
    public function __construct(
23
        private readonly string $group = 'default',
24
        private readonly bool $byValue = true,
25
        private readonly int $limit = 0,
26
        private readonly string|null $description = null,
27
        private readonly string|null $typeName = null,
28
        private readonly array $excludeFilters = [],
29
        private readonly array $includeFilters = [],
30
    ) {
31
    }
32
33
    public function getGroup(): string
34
    {
35
        return $this->group;
36
    }
37
38
    public function getByValue(): bool
39
    {
40
        return $this->byValue;
41
    }
42
43
    public function getLimit(): int
44
    {
45
        return $this->limit;
46
    }
47
48
    public function getDescription(): string|null
49
    {
50
        return $this->description;
51
    }
52
53
    public function getTypeName(): string|null
54
    {
55
        return $this->typeName;
56
    }
57
}
58