Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.0218 |
Changes | 0 |
1 | <?php |
||
24 | 6 | protected function getStringArgument(Node\Expr\MethodCall $node, int $index): ?string |
|
25 | { |
||
26 | 6 | if (!isset($node->args[$index])) { |
|
27 | 5 | return null; |
|
28 | } |
||
29 | |||
30 | 6 | if (!$node->args[$index]->value instanceof Node\Scalar\String_) { |
|
31 | 4 | return null; |
|
32 | } |
||
33 | |||
34 | 6 | $label = $node->args[$index]->value->value; |
|
35 | 6 | if (empty($label)) { |
|
36 | return null; |
||
37 | } |
||
38 | |||
39 | 6 | return $label; |
|
40 | } |
||
41 | } |
||
42 |