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