Passed
Pull Request — main (#39)
by Tom
02:17
created

Field::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 6
dl 0
loc 10
rs 10
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 describe a field for GraphQL
12
 */
13
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
14
class Field
15
{
16
    use ExcludeFilters;
1 ignored issue
show
Bug introduced by
The trait ApiSkeletons\Doctrine\OR...ttribute\ExcludeFilters requires the property $value which is not provided by ApiSkeletons\Doctrine\ORM\GraphQL\Attribute\Field.
Loading history...
17
18
    /**
19
     * @param Filters[] $excludeFilters
20
     * @param Filters[] $includeFilters
21
     */
22
    public function __construct(
23
        protected string $group = 'default',
24
        protected string|null $hydratorStrategy = null,
25
        protected string|null $description = null,
26
        protected string|null $type = null,
27
        array $excludeFilters = [],
28
        array $includeFilters = [],
29
    ) {
30
        $this->includeFilters = $includeFilters;
31
        $this->excludeFilters = $excludeFilters;
32
    }
33
34
    public function getGroup(): string
35
    {
36
        return $this->group;
37
    }
38
39
    public function getHydratorStrategy(): string|null
40
    {
41
        return $this->hydratorStrategy;
42
    }
43
44
    public function getDescription(): string|null
45
    {
46
        return $this->description;
47
    }
48
49
    public function getType(): string|null
50
    {
51
        return $this->type;
52
    }
53
}
54