Conditions | 5 |
Paths | 5 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5.0488 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
50 | 22 | public function compare(Point $point, $operator = '=') |
|
51 | { |
||
52 | 22 | $sum = $this->x * 10 + $this->y; |
|
53 | 22 | $sum2 = $point->x * 10 + $point->y; |
|
54 | switch ($operator) { |
||
55 | 22 | case '>': return $sum > $sum2; |
|
56 | 22 | case '>=': return $sum >= $sum2; |
|
57 | 17 | case '<': return $sum < $sum2; |
|
58 | 17 | case '<=': return $sum <= $sum2; |
|
59 | } |
||
60 | |||
61 | return $sum === $sum2; |
||
62 | } |
||
63 | } |
||
64 |
According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.
}
To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.