Total Complexity | 3 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class ExecutionResult implements SerializationInterface |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var GraphQLError[] |
||
13 | */ |
||
14 | protected $errors; |
||
15 | |||
16 | /** |
||
17 | * @var mixed[] |
||
18 | */ |
||
19 | protected $data; |
||
20 | |||
21 | /** |
||
22 | * ExecutionResult constructor. |
||
23 | * |
||
24 | * @param mixed[] $data |
||
25 | * @param GraphQLError[] $errors |
||
26 | */ |
||
27 | public function __construct(?array $data, ?array $errors) |
||
28 | { |
||
29 | $this->errors = $errors; |
||
30 | $this->data = $data; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param GraphQLError $error |
||
35 | * @return ExecutionResult |
||
36 | */ |
||
37 | public function addError(GraphQLError $error): ExecutionResult |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @inheritdoc |
||
45 | */ |
||
46 | public function toArray(): array |
||
54 |