Conditions | 9 |
Paths | 32 |
Total Lines | 28 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 9 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 14 | public function __construct( |
|
17 | string $name, |
||
18 | array $field, |
||
19 | ?callable $resolve = null, |
||
20 | ?callable $complexity = null, |
||
21 | ) { |
||
22 | 14 | $this->name = $name; |
|
23 | 14 | $this->type = $field['type']; |
|
24 | 14 | $this->mode = $field['mode'] ?? 0; |
|
25 | |||
26 | 14 | if (isset($field['description']) && \is_string($field['description'])) { |
|
27 | 1 | $this->description = $field['description']; |
|
28 | } |
||
29 | |||
30 | 14 | if (isset($field['deprecationReason']) && \is_string($field['deprecationReason'])) { |
|
31 | 1 | $this->deprecationReason = $field['deprecationReason']; |
|
32 | } |
||
33 | |||
34 | 14 | if (isset($field['arguments']) && \is_iterable($field['arguments'])) { |
|
35 | 1 | $this->arguments = $field['arguments']; |
|
36 | } |
||
37 | |||
38 | 14 | if (null !== $resolve) { |
|
39 | 8 | $this->resolveFn = $resolve; |
|
|
|||
40 | } |
||
41 | |||
42 | 14 | if (null !== $complexity) { |
|
43 | 8 | $this->complexityFn = $complexity; |
|
44 | } |
||
47 |