| Conditions | 9 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 9 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | 2 | public function getMaxAllowableHoleScore($par, $courseHandicap) |
|
| 44 | { |
||
| 45 | 2 | $maxScore = $par; |
|
| 46 | |||
| 47 | switch(true) { |
||
| 48 | 2 | case ($courseHandicap <= 9): |
|
| 49 | 2 | $maxScore = $par + 2; |
|
| 50 | 2 | break; |
|
| 51 | 1 | case (($courseHandicap > 9) && ($courseHandicap < 20)): //10-19 |
|
| 52 | 1 | $maxScore = 7; |
|
| 53 | 1 | break; |
|
| 54 | 1 | case (($courseHandicap >= 20) && ($courseHandicap < 30))://20-29 |
|
| 55 | 1 | $maxScore = 8; |
|
| 56 | 1 | break; |
|
| 57 | 1 | case (($courseHandicap >= 30) && ($courseHandicap < 40))://30-39 |
|
| 58 | 1 | $maxScore = 9; |
|
| 59 | 1 | break; |
|
| 60 | 1 | case ($courseHandicap >= 40): |
|
| 61 | 1 | $maxScore = 10; |
|
| 62 | } |
||
| 63 | 2 | return $maxScore; |
|
| 64 | } |
||
| 65 | } |
||
| 66 |