Failed Conditions
Push — master ( 05fc61...964283 )
by Adrien
02:24
created

Filter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 16
rs 10
ccs 1
cts 1
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQL\Doctrine\Attribute;
6
7
use Attribute;
8
9
/**
10
 * Attribute used to define custom filter.
11
 */
12
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
13
final class Filter implements ApiAttribute
14
{
15
    /**
16
     * @param string $field Name of the field on which to apply the operator.
17
     *
18
     * The field may or may not actually exist in the entity. It is merely used
19
     * to organize the filter correctly in the API.
20
     * @param string $operator key referring to the type instance of PHP class implementing the GraphQL type
21
     * @param string $type GraphQL leaf type name of the type of the field
22
     */
23 17
    public function __construct(
24
        public readonly string $field,
25
        public readonly string $operator,
26
        public readonly string $type,
27
    ) {
28
    }
29
}
30