Total Complexity | 3 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | abstract class AbstractRequest |
||
8 | { |
||
9 | /** |
||
10 | * @var string|null |
||
11 | */ |
||
12 | private $outputType; |
||
13 | |||
14 | /** |
||
15 | * @var string|null |
||
16 | */ |
||
17 | private $name; |
||
18 | |||
19 | /** |
||
20 | * @param mixed[] $attributes |
||
21 | */ |
||
22 | public function __construct(array $attributes = []) |
||
23 | { |
||
24 | $this->outputType = $attributes['outputType'] ?? null; |
||
25 | $this->name = $attributes['name'] ?? null; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Returns the GraphQL return type of the request (as a string). |
||
30 | * The string can represent the FQCN of the type or an entry in the container resolving to the GraphQL type. |
||
31 | * |
||
32 | * @return string|null |
||
33 | */ |
||
34 | public function getOutputType(): ?string |
||
35 | { |
||
36 | return $this->outputType; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Returns the name of the GraphQL query/mutation/field. |
||
41 | * If not specified, the name of the method should be used instead. |
||
42 | * |
||
43 | * @return null|string |
||
44 | */ |
||
45 | public function getName(): ?string |
||
48 | } |
||
49 | } |
||
50 |