Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | #[Attribute(Attribute::TARGET_METHOD)] |
||
17 | final class Field implements ApiAttribute |
||
18 | { |
||
19 | public array $args = []; |
||
20 | |||
21 | public null|string|Type $type = null; |
||
22 | |||
23 | /** |
||
24 | * @param null|string $name Can be used to alias the field |
||
25 | * @param null|string $type FQCN of PHP class implementing the GraphQL type |
||
26 | */ |
||
27 | 15 | public function __construct( |
|
28 | public ?string $name = null, |
||
29 | null|string $type = null, |
||
30 | public ?string $description = null, |
||
31 | ) { |
||
32 | 15 | $this->type = $type; |
|
33 | } |
||
34 | |||
35 | 9 | public function toArray(): array |
|
47 | ]; |
||
48 | } |
||
50 |