Completed
Push — master ( 5d04a1...0cf74a )
by Vincenzo
02:49
created
api/Lib/DsManager/Helpers/LeagueFixtureGenerator.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -5,25 +5,25 @@
 block discarded – undo
5 5
 
6 6
 class LeagueFixtureGenerator
7 7
 {
8
-    public static function generate(array $teams)
9
-    {
10
-        $numTeams = count($teams);
11
-        $numRounds = ($numTeams - 1);
12
-        $halfSize = $numTeams / 2;
8
+	public static function generate(array $teams)
9
+	{
10
+		$numTeams = count($teams);
11
+		$numRounds = ($numTeams - 1);
12
+		$halfSize = $numTeams / 2;
13 13
 
14
-        $away = array_splice($teams, $halfSize);
15
-        $home = $teams;
16
-        $rounds = [];
17
-        for ($i = 0; $i < $numRounds ; $i++) {
18
-            for ($j = 0; $j < count($home); $j++) {
19
-                $rounds[$i][$j]["home_team_id"] = $home[$j]['id'];
20
-                $rounds[$i][$j]["away_team_id"] = $away[$j]['id'];
21
-            }
22
-            if (count($home) + count($away) - 1 > 2) {
23
-                array_unshift($away, array_shift(array_splice($home, 1, 1)));
24
-                array_push($home, array_pop($away));
25
-            }
26
-        }
27
-        return $rounds;
28
-    }
14
+		$away = array_splice($teams, $halfSize);
15
+		$home = $teams;
16
+		$rounds = [];
17
+		for ($i = 0; $i < $numRounds ; $i++) {
18
+			for ($j = 0; $j < count($home); $j++) {
19
+				$rounds[$i][$j]["home_team_id"] = $home[$j]['id'];
20
+				$rounds[$i][$j]["away_team_id"] = $away[$j]['id'];
21
+			}
22
+			if (count($home) + count($away) - 1 > 2) {
23
+				array_unshift($away, array_shift(array_splice($home, 1, 1)));
24
+				array_push($home, array_pop($away));
25
+			}
26
+		}
27
+		return $rounds;
28
+	}
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
         $away = array_splice($teams, $halfSize);
15 15
         $home = $teams;
16 16
         $rounds = [];
17
-        for ($i = 0; $i < $numRounds ; $i++) {
17
+        for ($i = 0; $i < $numRounds; $i++) {
18 18
             for ($j = 0; $j < count($home); $j++) {
19 19
                 $rounds[$i][$j]["home_team_id"] = $home[$j]['id'];
20 20
                 $rounds[$i][$j]["away_team_id"] = $away[$j]['id'];
Please login to merge, or discard this patch.