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