| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3.0067 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | 23 | public function getClassFromMethod(string $docBlock, string $method): string |
|
| 10 | { |
||
| 11 | 23 | if ($docBlock === '') { |
|
| 12 | 1 | return ''; |
|
| 13 | } |
||
| 14 | |||
| 15 | 22 | if (strcasecmp(substr(PHP_OS, 0, 3), 'WIN') == 0) { |
|
| 16 | $docBlock = str_replace("\n", PHP_EOL, $docBlock); |
||
| 17 | } |
||
| 18 | |||
| 19 | 22 | $lines = array_filter( |
|
| 20 | 22 | explode(PHP_EOL, $docBlock), |
|
| 21 | 22 | static fn (string $l) => str_contains($l, $method), |
|
| 22 | 22 | ); |
|
| 23 | /** @psalm-suppress RedundantCast */ |
||
| 24 | 22 | $lineSplit = (array)explode(' ', (string)reset($lines)); |
|
| 25 | |||
| 26 | 22 | return $lineSplit[3] ?? ''; |
|
| 27 | } |
||
| 29 |