Completed
Push — master ( 5d04a1...0cf74a )
by Vincenzo
02:49
created
api/index.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $c = new \Slim\Container($configuration);
22 22
 $api = new \Slim\App($c);
23 23
 
24
-$api->get('/ping', function ($request, $response, $args) {
24
+$api->get('/ping', function($request, $response, $args) {
25 25
     $jsonResp = json_encode(
26 26
         [
27 27
             "status" => "service up",
@@ -31,34 +31,34 @@  discard block
 block discarded – undo
31 31
     return Responder::getJsonResponse($jsonResp, $response);
32 32
 });
33 33
 
34
-$api->get('/players', function ($request, $response, $args) {
34
+$api->get('/players', function($request, $response, $args) {
35 35
     $json = json_encode(Player::all());
36 36
     return Responder::getJsonResponse($json, $response);
37 37
 });
38 38
 
39 39
 
40
-$api->get('/players/{id}', function ($request, $response, $args) {
40
+$api->get('/players/{id}', function($request, $response, $args) {
41 41
     return Responder::getJsonResponse(
42 42
         Player::findOrFail($args['id']),
43 43
         $response
44 44
     );
45 45
 });
46 46
 
47
-$api->get('/coaches', function ($request, $response, $args) {
47
+$api->get('/coaches', function($request, $response, $args) {
48 48
     return Responder::getJsonResponse(
49 49
         Coach::all(),
50 50
         $response
51 51
     );
52 52
 });
53 53
 
54
-$api->get('/teams', function ($request, $response, $args) {
54
+$api->get('/teams', function($request, $response, $args) {
55 55
     return Responder::getJsonResponse(
56 56
         Team::all(),
57 57
         $response
58 58
     );
59 59
 });
60 60
 
61
-$api->get('/teams/{id}', function ($request, $response, $args) {
61
+$api->get('/teams/{id}', function($request, $response, $args) {
62 62
     return Responder::getJsonResponse(
63 63
         Team::complete()
64 64
             ->where(
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     );
71 71
 });
72 72
 
73
-$api->get('/teams/{id}/players', function ($request, $response, $args) {
73
+$api->get('/teams/{id}/players', function($request, $response, $args) {
74 74
     return Responder::getJsonResponse(
75 75
         Team::with(
76 76
             'roster'
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     );
84 84
 });
85 85
 
86
-$api->get('/teams/{id}/players/{playerId}', function ($request, $response, $args) {
86
+$api->get('/teams/{id}/players/{playerId}', function($request, $response, $args) {
87 87
     return Responder::getJsonResponse(
88 88
         Player::statistics()->where(
89 89
             [
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     );
96 96
 });
97 97
 
98
-$api->get('/teams/{id}/coach', function ($request, $response, $args) {
98
+$api->get('/teams/{id}/coach', function($request, $response, $args) {
99 99
     return Responder::getJsonResponse(
100 100
         Team::with(
101 101
             'coach'
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
     );
109 109
 });
110 110
 
111
-$api->get('/leagues', function ($request, $response, $args) {
111
+$api->get('/leagues', function($request, $response, $args) {
112 112
     return Responder::getJsonResponse(
113 113
         League::all(),
114 114
         $response
115 115
     );
116 116
 });
117 117
 
118
-$api->get('/leagues/{id}', function ($request, $response, $args) {
118
+$api->get('/leagues/{id}', function($request, $response, $args) {
119 119
     return Responder::getJsonResponse(
120 120
         League::with('rounds')
121 121
             ->where(
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $response
127 127
     );
128 128
 });
129
-$api->get('/leagues/{id}/rounds/{roundId}/matches', function ($request, $response, $args) {
129
+$api->get('/leagues/{id}/rounds/{roundId}/matches', function($request, $response, $args) {
130 130
     return Responder::getJsonResponse(
131 131
         Match::teams()
132 132
             ->where(
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
         $response
138 138
     );
139 139
 });
140
-$api->get('/matches', function ($request, $response, $args) {
140
+$api->get('/matches', function($request, $response, $args) {
141 141
     return Responder::getJsonResponse(
142 142
         Match::teams()->get(),
143 143
         $response
144 144
     );
145 145
 });
146 146
 
147
-$api->post('/matches', function ($request, $response, $args) {
147
+$api->post('/matches', function($request, $response, $args) {
148 148
     $json = $request->getBody();
149 149
     $json = json_decode($json, true);
150 150
     return Responder::getJsonResponse(
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     );
156 156
 });
157 157
 
158
-$api->get('/matches/{id}', function ($request, $response, $args) {
158
+$api->get('/matches/{id}', function($request, $response, $args) {
159 159
     return Responder::getJsonResponse(
160 160
         Match::complete()
161 161
             ->where(
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     );
168 168
 });
169 169
 
170
-$api->get('/matches/{id}/result', function ($request, $response, $args) {
170
+$api->get('/matches/{id}/result', function($request, $response, $args) {
171 171
     $result = MatchResult::complete()
172 172
         ->where(
173 173
             [
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     );
182 182
 });
183 183
 
184
-$api->put('/matches/{id}/simulate', function ($request, $response, $args) {
184
+$api->put('/matches/{id}/simulate', function($request, $response, $args) {
185 185
     return Responder::getJsonResponse(
186 186
         MatchSimulator::simulate(
187 187
             $args['id']
Please login to merge, or discard this patch.
api/database/migrations/CreateLeagueRoundsTable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function run()
14 14
     {
15 15
         Capsule::schema()->dropIfExists('league_rounds');
16
-        Capsule::schema()->create('league_rounds', function (Blueprint $table) {
16
+        Capsule::schema()->create('league_rounds', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('league_id');
19 19
             $table->integer('day')->default(0);
Please login to merge, or discard this patch.
api/Lib/DsManager/Helpers/LeagueFixtureGenerator.php 1 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.