@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | { |
| 10 | 10 | public function __construct(Player $player) |
| 11 | 11 | { |
| 12 | - $this->differentialArray = array(0,1,1,1,1,1,1,2,2,3,3,4,4,5,5,6,6,7,8,9,10); |
|
| 12 | + $this->differentialArray = array(0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 9, 10); |
|
| 13 | 13 | $this->player = $player; |
| 14 | 14 | } |
| 15 | 15 | |
@@ -20,16 +20,16 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $i = 1; |
| 22 | 22 | foreach ($rounds as $round) { |
| 23 | - $differentials[$i] = $round->esc; |
|
| 23 | + $differentials[$i] = $round->esc; |
|
| 24 | 24 | $i++; |
| 25 | 25 | } |
| 26 | 26 | sort($differentials); |
| 27 | - $chunkedRounds = array_chunk($differentials,$differential,true); |
|
| 27 | + $chunkedRounds = array_chunk($differentials, $differential, true); |
|
| 28 | 28 | $roundsUsed = $chunkedRounds[0]; |
| 29 | 29 | |
| 30 | 30 | $sumofDifferentials = array_sum($roundsUsed); |
| 31 | 31 | $handicap = (($sumofDifferentials / $differential) * .96) - 36; |
| 32 | - $handicap = round($handicap ,2); |
|
| 32 | + $handicap = round($handicap, 2); |
|
| 33 | 33 | |
| 34 | 34 | return $handicap; |
| 35 | 35 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | // |
| 38 | 38 | public function differential($numberOfScores) |
| 39 | 39 | { |
| 40 | - if($numberOfScores <= 20){ |
|
| 40 | + if ($numberOfScores <= 20) { |
|
| 41 | 41 | return $this->differentialArray[$numberOfScores]; |
| 42 | 42 | } else { |
| 43 | 43 | return $this->differentialArray[20]; |
@@ -5,10 +5,9 @@ discard block |
||
| 5 | 5 | use \Player as Player; |
| 6 | 6 | use \Round as Round; |
| 7 | 7 | |
| 8 | -class Handicap |
|
| 9 | -{ |
|
| 8 | +class Handicap { |
|
| 10 | 9 | public function __construct(Player $player) |
| 11 | - { |
|
| 10 | + { |
|
| 12 | 11 | $this->differentialArray = array(0,1,1,1,1,1,1,2,2,3,3,4,4,5,5,6,6,7,8,9,10); |
| 13 | 12 | $this->player = $player; |
| 14 | 13 | } |
@@ -19,7 +18,7 @@ discard block |
||
| 19 | 18 | $differential = $this->differential($rounds->count()); |
| 20 | 19 | |
| 21 | 20 | $i = 1; |
| 22 | - foreach ($rounds as $round) { |
|
| 21 | + foreach ($rounds as $round) { |
|
| 23 | 22 | $differentials[$i] = $round->esc; |
| 24 | 23 | $i++; |
| 25 | 24 | } |
@@ -37,7 +36,7 @@ discard block |
||
| 37 | 36 | // |
| 38 | 37 | public function differential($numberOfScores) |
| 39 | 38 | { |
| 40 | - if($numberOfScores <= 20){ |
|
| 39 | + if($numberOfScores <= 20) { |
|
| 41 | 40 | return $this->differentialArray[$numberOfScores]; |
| 42 | 41 | } else { |
| 43 | 42 | return $this->differentialArray[20]; |