Conditions | 9 |
Paths | 6 |
Total Lines | 21 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
50 | private function maxAllowableScore($par, $handicap) |
||
51 | { |
||
52 | switch($handicap) { |
||
53 | case ($handicap < 4.6): |
||
54 | $maxScore = $par + 2; |
||
55 | break; |
||
56 | case (($handicap >= 4.6) && ($handicap < 9.6)): |
||
57 | $maxScore = 7; |
||
58 | break; |
||
59 | case (($handicap >= 9.6) && ($handicap < 14.6)): |
||
60 | $maxScore = 8; |
||
61 | break; |
||
62 | case (($handicap >= 14.6) && ($handicap < 19.6)): |
||
63 | $maxScore = 9; |
||
64 | break; |
||
65 | case ($handicap >= 19.6): |
||
66 | $maxScore = 10; |
||
67 | } |
||
68 | |||
69 | return $maxScore; |
||
70 | } |
||
71 | } |
||
72 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: