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