Completed
Push — master ( f26f82...d0520b )
by Michael
03:05
created
app/library/Classes/Handicap.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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];
Please login to merge, or discard this patch.
Braces   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,10 +5,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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];
Please login to merge, or discard this patch.