Total Complexity | 6 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class CoercedValue |
||
12 | { |
||
13 | /** |
||
14 | * @var GraphQLException[] |
||
15 | */ |
||
16 | private $errors; |
||
17 | |||
18 | /** |
||
19 | * @var mixed|null |
||
20 | */ |
||
21 | private $value; |
||
22 | |||
23 | /** |
||
24 | * CoercedValue constructor. |
||
25 | * @param $value |
||
26 | * @param array|null $errors |
||
27 | */ |
||
28 | public function __construct($value, ?array $errors) |
||
29 | { |
||
30 | $this->errors = $errors; |
||
31 | $this->value = $value; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return GraphQLException[] |
||
36 | */ |
||
37 | public function getErrors(): array |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @return bool |
||
44 | */ |
||
45 | public function hasErrors(): bool |
||
46 | { |
||
47 | return !empty($this->errors); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @param GraphQLException[] $errors |
||
52 | */ |
||
53 | public function setErrors(array $errors): void |
||
54 | { |
||
55 | $this->errors = $errors; |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return mixed |
||
60 | */ |
||
61 | public function getValue() |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param mixed $value |
||
68 | */ |
||
69 | public function setValue($value): void |
||
72 | } |
||
73 | } |