| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | 3 | public function getClassFromMethod(string $docBlock, string $method): string |
|
| 10 | { |
||
| 11 | 3 | if ($docBlock === '') { |
|
| 12 | 1 | return ''; |
|
| 13 | } |
||
| 14 | |||
| 15 | 2 | $lines = array_filter( |
|
| 16 | 2 | explode(PHP_EOL, $docBlock), |
|
| 17 | 2 | static fn (string $l) => str_contains($l, $method) |
|
| 18 | ); |
||
| 19 | |||
| 20 | 2 | $lineSplit = (array)explode(' ', (string)reset($lines)); |
|
| 21 | |||
| 22 | 2 | return $lineSplit[3] ?? ''; |
|
| 23 | } |
||
| 25 |