Passed
Pull Request — main (#102)
by Tom
04:31 queued 01:34
created

Field   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 37
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A getDescription() 0 3 1
A getExcludeCriteria() 0 3 1
A getGroup() 0 3 1
A getStrategy() 0 3 1
A __construct() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiSkeletons\Doctrine\GraphQL\Attribute;
6
7
use Attribute;
8
9
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
10
class Field
11
{
12
    /** @param string[] $excludeCriteria */
13
    public function __construct(
14
        protected string $group = 'default',
15
        protected string|null $strategy = null,
16
        protected string|null $description = null,
17
        protected string|null $type = null,
18
        private array $excludeCriteria = [],
19
    ) {
20
    }
21
22
    public function getGroup(): string
23
    {
24
        return $this->group;
25
    }
26
27
    public function getStrategy(): string|null
28
    {
29
        return $this->strategy;
30
    }
31
32
    public function getDescription(): string|null
33
    {
34
        return $this->description;
35
    }
36
37
    public function getType(): string|null
38
    {
39
        return $this->type;
40
    }
41
42
    /** @return string[] */
43
    public function getExcludeCriteria(): array
44
    {
45
        return $this->excludeCriteria;
46
    }
47
}
48