Completed
Push — master ( cbeeb7...87faf2 )
by Michael
02:39
created
app/library/Classes/Handicap.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     
14 14
 	public function __construct(Player $player, $roundsUsed = 20)
15 15
     {
16
-        $this->differentialArray = array(0,1,1,1,1,1,1,2,2,3,3,4,4,5,5,6,6,7,8,9,10);
16
+        $this->differentialArray = array(0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 9, 10);
17 17
 		$this->player = $player;
18 18
         $this->roundsUsed = $roundsUsed; //20 is USGA standard;  Some leagues may want to adjust.
19 19
     }
@@ -25,16 +25,16 @@  discard block
 block discarded – undo
25 25
 		
26 26
 		$i = 1;
27 27
 		foreach ($rounds as $round) {			
28
-				$differentials[$i]  = $round->esc;
28
+				$differentials[$i] = $round->esc;
29 29
 				$i++;
30 30
 		}
31 31
 		sort($differentials);
32
-		$chunkedRounds = array_chunk($differentials,$differential,true);
32
+		$chunkedRounds = array_chunk($differentials, $differential, true);
33 33
 		$roundsUsed = $chunkedRounds[0];
34 34
 		
35 35
 		$sumofDifferentials = array_sum($roundsUsed);
36 36
 		$handicap = (($sumofDifferentials / $differential) * .96) - 36;
37
-		$handicap = round($handicap ,2);
37
+		$handicap = round($handicap, 2);
38 38
 		
39 39
 		return $handicap;
40 40
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	//
43 43
 	public function differential($numberOfScores)
44 44
 	{
45
-		if($numberOfScores <= 20){
45
+		if ($numberOfScores <= 20) {
46 46
 			return $this->differentialArray[$numberOfScores];
47 47
 		} else {
48 48
 			return $this->differentialArray[20];
Please login to merge, or discard this patch.