| Conditions | 5 |
| Paths | 8 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | public function reverseConfiguration($url) |
||
| 49 | { |
||
| 50 | $thirdPart = substr($url, strrpos($url, '/') + 1); |
||
| 51 | preg_match_all('/^([\d]{1,2})-[\w]+-([\d]{1,2})/', $thirdPart, $matches); |
||
| 52 | |||
| 53 | $seance = isset($matches[1][0]) ? $matches[1][0] : null; |
||
| 54 | $week = isset($matches[2][0]) ? $matches[2][0] : null; |
||
| 55 | |||
| 56 | if (null === $seance || null === $week) { |
||
| 57 | return null; |
||
| 58 | } |
||
| 59 | |||
| 60 | return [ |
||
| 61 | 'seance' => $seance, |
||
| 62 | 'week' => $week, |
||
| 63 | ]; |
||
| 64 | } |
||
| 65 | } |
||
| 66 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.