Passed
Push — develop ( 58c14e...47df8a )
by Nikita
01:36 queued 13s
created
app/Repositories/ServerRepository.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
     public function getServersForUser(int $userId)
108 108
     {
109
-        $qb = QueryBuilder::for(Server::class)
109
+        $qb = QueryBuilder::for (Server::class)
110 110
             ->allowedFilters('ds_id')
111 111
             ->with('game:code,name,engine,engine_version')
112 112
             ->whereRaw('id IN(SELECT server_id FROM server_user su WHERE su.user_id = ?)', [$userId]);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
     public function getAllServers()
134 134
     {
135
-        $qb = QueryBuilder::for(Server::class)
135
+        $qb = QueryBuilder::for (Server::class)
136 136
             ->allowedFilters('ds_id')
137 137
             ->allowedAppends(['full_path', 'is_online'])
138 138
             ->with('game:code,name,engine,engine_version');
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
         $query = DB::table($serversTable)
173 173
             ->selectRaw("{$serversTable}.*, {$gamesTable}.name as game_name")
174
-            ->whereIn('game_id', function ($query) use ($engines, $serversTable, $gamesTable): void {
174
+            ->whereIn('game_id', function($query) use ($engines, $serversTable, $gamesTable): void {
175 175
                 $query->select('code')
176 176
                     ->from($gamesTable)
177 177
                     ->whereIn('engine', $engines);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     public function search($query)
198 198
     {
199 199
         return $this->model->select(['id', 'name', 'server_ip', 'server_port', 'game_id', 'game_mod_id'])
200
-            ->with(['game' => function ($query): void {
200
+            ->with(['game' => function($query): void {
201 201
                 $query->select('code', 'name');
202 202
             }])
203 203
             ->where('name', 'LIKE', '%' . $query . '%')
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
      */
211 211
     public function update(Server $server, array $attributes): void
212 212
     {
213
-        $attributes['enabled']   = (bool)array_key_exists('enabled', $attributes);
214
-        $attributes['blocked']   = (bool)array_key_exists('blocked', $attributes);
215
-        $attributes['installed'] = (bool)array_key_exists('installed', $attributes);
213
+        $attributes['enabled']   = (bool) array_key_exists('enabled', $attributes);
214
+        $attributes['blocked']   = (bool) array_key_exists('blocked', $attributes);
215
+        $attributes['installed'] = (bool) array_key_exists('installed', $attributes);
216 216
 
217 217
         if (isset($attributes['ds_id'])) {
218 218
             $server->ds_id = $attributes['ds_id'];
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -106,10 +106,11 @@  discard block
 block discarded – undo
106 106
 
107 107
     public function getServersForUser(int $userId)
108 108
     {
109
-        $qb = QueryBuilder::for(Server::class)
110
-            ->allowedFilters('ds_id')
109
+        $qb = QueryBuilder::for(Server::class) {
110
+                    ->allowedFilters('ds_id')
111 111
             ->with('game:code,name,engine,engine_version')
112 112
             ->whereRaw('id IN(SELECT server_id FROM server_user su WHERE su.user_id = ?)', [$userId]);
113
+        }
113 114
 
114 115
         return $qb->get([
115 116
             'id',
@@ -132,10 +133,11 @@  discard block
 block discarded – undo
132 133
 
133 134
     public function getAllServers()
134 135
     {
135
-        $qb = QueryBuilder::for(Server::class)
136
-            ->allowedFilters('ds_id')
136
+        $qb = QueryBuilder::for(Server::class) {
137
+                    ->allowedFilters('ds_id')
137 138
             ->allowedAppends(['full_path', 'is_online'])
138 139
             ->with('game:code,name,engine,engine_version');
140
+        }
139 141
 
140 142
         return $qb->get([
141 143
             'id',
Please login to merge, or discard this patch.