We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
11 | 2 | public static function toConfig(Node $node): array |
|
12 | { |
||
13 | 2 | $config = DescriptionNode::toConfig($node); |
|
14 | |||
15 | 2 | $values = []; |
|
16 | 2 | foreach ($node->values as $value) { |
|
17 | 2 | $values[$value->name->value] = DescriptionNode::toConfig($node) + [ |
|
18 | 2 | 'value' => $value->name->value, |
|
19 | ]; |
||
20 | |||
21 | 2 | $directiveConfig = DirectiveNode::toConfig($value); |
|
22 | 2 | if (isset($directiveConfig['deprecationReason'])) { |
|
23 | 2 | $values[$value->name->value]['deprecationReason'] = $directiveConfig['deprecationReason']; |
|
24 | } |
||
25 | } |
||
26 | 2 | $config['values'] = $values; |
|
27 | |||
28 | return [ |
||
29 | 2 | 'type' => 'enum', |
|
30 | 2 | 'config' => $config, |
|
31 | ]; |
||
32 | } |
||
33 | } |
||
34 |