We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 9 |
Paths | 8 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 9 |
Changes | 0 |
1 | <?php |
||
41 | 1 | private static function astValueNodeToConfig(ValueNode $valueNode) |
|
42 | { |
||
43 | 1 | $config = null; |
|
44 | 1 | switch ($valueNode->kind) { |
|
|
|||
45 | case NodeKind::INT: |
||
46 | case NodeKind::FLOAT: |
||
47 | case NodeKind::STRING: |
||
48 | case NodeKind::BOOLEAN: |
||
49 | case NodeKind::ENUM: |
||
50 | 1 | $config = $valueNode->value; |
|
51 | 1 | break; |
|
52 | |||
53 | case NodeKind::LST: |
||
54 | 1 | $config = []; |
|
55 | 1 | foreach ($valueNode->values as $node) { |
|
56 | 1 | $config[] = self::astValueNodeToConfig($node); |
|
57 | } |
||
58 | 1 | break; |
|
59 | |||
60 | case NodeKind::NULL: |
||
61 | 1 | $config = null; |
|
62 | 1 | break; |
|
63 | } |
||
64 | |||
65 | 1 | return $config; |
|
66 | } |
||
67 | } |
||
68 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: