Passed
Pull Request — master (#610)
by John
05:33
created
app/Providers/RouteServiceProvider.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     protected function mapWebRoutes()
53 53
     {
54 54
         Route::middleware('web')
55
-             ->namespace($this->namespace)
56
-             ->group(base_path('routes/web.php'));
55
+                ->namespace($this->namespace)
56
+                ->group(base_path('routes/web.php'));
57 57
     }
58 58
 
59 59
     /**
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
     protected function mapApiRoutes()
67 67
     {
68 68
         Route::prefix('api')
69
-             ->middleware('api')
70
-             ->namespace($this->namespace)
71
-             ->group(base_path('routes/api.php'));
69
+                ->middleware('api')
70
+                ->namespace($this->namespace)
71
+                ->group(base_path('routes/api.php'));
72 72
     }
73 73
 }
Please login to merge, or discard this patch.
app/Models/ResponseModel.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
             $statusCode=200;
15 15
         }
16 16
         $output=[
17
-             'ret' => $statusCode,
17
+                'ret' => $statusCode,
18 18
             'desc' => is_null($desc) ? self::desc($statusCode) : $desc,
19 19
             'data' => $data
20 20
         ];
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             $statusCode=1000;
28 28
         }
29 29
         $output=[
30
-             'ret' => $statusCode,
30
+                'ret' => $statusCode,
31 31
             'desc' => is_null($desc) ? self::desc($statusCode) : $desc,
32 32
             'data' => $data
33 33
         ];
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
             '451'  => "Unavailable For Legal Reasons",
45 45
 
46 46
             '1000' => "Unspecified Response", /** Under normal condictions those errors shouldn't been displayed to end users
47
-                                                 *  unless they attempt to do so, some submissions should be intercepted
48
-                                                 *  by the frontend before the request sended
49
-                                                 */
47
+             *  unless they attempt to do so, some submissions should be intercepted
48
+             *  by the frontend before the request sended
49
+             */
50 50
             '1001' => "Internal Sever Error",
51 51
             '1002' => "Service Currently Unavailable",
52 52
             '1003' => "Missing Params",
Please login to merge, or discard this patch.
app/Models/ContestModel.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -265,7 +265,7 @@
 block discarded – undo
265 265
                             $query=$query->where(["practice"=>$filter['practice']]);
266 266
                         }
267 267
                         $query->where('public', 1)
268
-                              ->where('audit_status', 1);
268
+                                ->where('audit_status', 1);
269 269
                     }
270 270
                 )
271 271
                 ->orWhere(
Please login to merge, or discard this patch.
Braces   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                     $paginator=$paginator->where(["practice"=>$filter['practice']]);
229 229
                 }
230 230
                 $paginator=$paginator ->paginate(10);
231
-            }elseif ($filter['public']=='0') {
231
+            } elseif ($filter['public']=='0') {
232 232
                 $paginator=DB::table('group_member')
233 233
                 ->groupBy('contest.cid')
234 234
                 ->select('contest.*')
@@ -1563,8 +1563,7 @@  discard block
 block discarded – undo
1563 1563
                     if (time()>$chache['end_time']) {
1564 1564
                         $this->storeContestRankInMySQL($cid, $ret);
1565 1565
                     }
1566
-                }
1567
-                else {
1566
+                } else {
1568 1567
                     $ret=[];
1569 1568
                     $chache=[];
1570 1569
                     $chache['contest_info']=DB::table("contest")->where("cid", $cid)->first();
@@ -1663,8 +1662,9 @@  discard block
 block discarded – undo
1663 1662
     {
1664 1663
         $id=count($ret);
1665 1664
         foreach ($ret as $key => $r) {
1666
-            if ($r['uid']==$uid)
1667
-                $id=$key;
1665
+            if ($r['uid']==$uid) {
1666
+                            $id=$key;
1667
+            }
1668 1668
         }
1669 1669
         if ($contest_info["rule"]==1) {
1670 1670
             // ACM/ICPC Mode
@@ -1828,8 +1828,7 @@  discard block
 block discarded – undo
1828 1828
             return DB::table("contest_clarification")->where('ccid', '=', $ccid)->update([
1829 1829
                 "public"=>1
1830 1830
             ]);
1831
-        }
1832
-        else
1831
+        } else
1833 1832
         {
1834 1833
             return DB::table("contest_clarification")->where('ccid', '=', $ccid)->update([
1835 1834
                 "public"=>0
@@ -2004,12 +2003,10 @@  discard block
 block discarded – undo
2004 2003
             $zipFile
2005 2004
                 ->saveAsFile(base_path('storage/app/private/'.$path.$cid.".zip")); // save the archive to a file
2006 2005
                 //->extractTo(base_path('storage/app/private/'.$path)); // extract files to the specified directory
2007
-        }
2008
-        catch (\PhpZip\Exception\ZipException $e) {
2006
+        } catch (\PhpZip\Exception\ZipException $e) {
2009 2007
             // handle exception
2010 2008
             Log::debug($e);
2011
-        }
2012
-        finally {
2009
+        } finally {
2013 2010
             $zipFile->close();
2014 2011
         }
2015 2012
     }
Please login to merge, or discard this patch.
app/Http/Controllers/ProblemController.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -150,10 +150,10 @@
 block discarded – undo
150 150
     }
151 151
 
152 152
         /**
153
-     * Show the Problem Discussion Page.
154
-     *
155
-     * @return Response
156
-     */
153
+         * Show the Problem Discussion Page.
154
+         *
155
+         * @return Response
156
+         */
157 157
     public function discussion($pcode)
158 158
     {
159 159
         //TODO
Please login to merge, or discard this patch.
app/Jobs/AntiCheat.php 1 patch
Braces   +17 added lines, -6 removed lines patch added patch discarded remove patch
@@ -57,7 +57,9 @@  discard block
 block discarded – undo
57 57
         $cid=$this->cid;
58 58
         $contest=EloquentContestModel::find($cid);
59 59
 
60
-        if (!$contest->isJudgingComplete()) throw new Exception('Judging Incompleted');
60
+        if (!$contest->isJudgingComplete()) {
61
+            throw new Exception('Judging Incompleted');
62
+        }
61 63
 
62 64
         $acceptedSubmissions=$contest->submissions->whereIn('verdict', [
63 65
             'Accepted',
@@ -79,8 +81,11 @@  discard block
 block discarded – undo
79 81
                 $lang=$this->supportLang[$lang];
80 82
                 $ext=$lang;
81 83
                 Storage::put("contest/anticheat/$cid/raw/$prob/$lang/[$submission->uid][$submission->sid].$ext", $submission->solution);
82
-                if (!isset($probLangs[$prob][$lang])) $probLangs[$prob][$lang]=1;
83
-                else $probLangs[$prob][$lang]++;
84
+                if (!isset($probLangs[$prob][$lang])) {
85
+                    $probLangs[$prob][$lang]=1;
86
+                } else {
87
+                    $probLangs[$prob][$lang]++;
88
+                }
84 89
                 $totProb++;
85 90
             }
86 91
         }
@@ -148,13 +153,19 @@  discard block
 block discarded – undo
148 153
     private function afterWork($cid, $prob, $lang, $rawContent)
149 154
     {
150 155
         foreach (preg_split('~[\r\n]+~', $rawContent) as $line) {
151
-            if (blank($line) or ctype_space($line)) continue;
156
+            if (blank($line) or ctype_space($line)) {
157
+                continue;
158
+            }
152 159
             // [3057][64659].c++ consists for 100 % of [3057][64679].c++ material
153 160
             $line=explode('%', $line);
154
-            if (!isset($line[1])) continue;
161
+            if (!isset($line[1])) {
162
+                continue;
163
+            }
155 164
             [$uid1, $sid1, $percentage]=sscanf($line[0], "[%d][%d].$lang consists for %d ");
156 165
             [$uid2, $sid2]=sscanf($line[1], " of [%d][%d].$lang material");
157
-            if ($uid1==$uid2) continue;
166
+            if ($uid1==$uid2) {
167
+                continue;
168
+            }
158 169
             $username1=User::find($uid1)->name;
159 170
             $username2=User::find($uid2)->name;
160 171
             $this->retArr[]=[
Please login to merge, or discard this patch.
app/Exports/GroupAnalysisExport.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
     }
30 30
 
31 31
     /**
32
-    * @return array
33
-    */
32
+     * @return array
33
+     */
34 34
     public function registerEvents(): array
35 35
     {
36 36
         return [
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
     }
48 48
 
49 49
     /**
50
-    * @return \Illuminate\Support\Collection
51
-    */
50
+     * @return \Illuminate\Support\Collection
51
+     */
52 52
     public function collection()
53 53
     {
54 54
         $maxium=$this->config['maxium'] ?? false;
Please login to merge, or discard this patch.
app/Http/Controllers/Group/IndexController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,9 @@
 block discarded – undo
96 96
         $groupModel=new GroupModel();
97 97
         $basic_info=$groupModel->details($gcode);
98 98
         $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id);
99
-        if ($clearance<1) return Redirect::route('group.detail', ['gcode' => $gcode]);
99
+        if ($clearance<1) {
100
+            return Redirect::route('group.detail', ['gcode' => $gcode]);
101
+        }
100 102
         $group_info=$groupModel->details($gcode);
101 103
         return view('group.settings.analysis', [
102 104
             'page_title'=>"Group Analysis",
Please login to merge, or discard this patch.
app/Http/Controllers/Ajax/GroupController.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -184,9 +184,13 @@
 block discarded – undo
184 184
         $all_data=$request->all();
185 185
 
186 186
         $groupModel=new OutdatedGroupModel();
187
-        if ($all_data["gcode"]=="create") return ResponseModel::err(7005);
187
+        if ($all_data["gcode"]=="create") {
188
+            return ResponseModel::err(7005);
189
+        }
188 190
         $is_group=$groupModel->isGroup($all_data["gcode"]);
189
-        if ($is_group) return ResponseModel::err(7006);
191
+        if ($is_group) {
192
+            return ResponseModel::err(7006);
193
+        }
190 194
 
191 195
         $allow_extension=['jpg', 'png', 'jpeg', 'gif', 'bmp'];
192 196
         if (!empty($request->file('img')) && $request->file('img')->isValid()) {
Please login to merge, or discard this patch.
app/Http/Controllers/Ajax/GroupManageController.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -247,11 +247,17 @@
 block discarded – undo
247 247
 
248 248
         $groupModel=new GroupModel();
249 249
         $is_user=$groupModel->isUser($all_data["email"]);
250
-        if (!$is_user) return ResponseModel::err(2006);
250
+        if (!$is_user) {
251
+            return ResponseModel::err(2006);
252
+        }
251 253
         $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id);
252
-        if ($clearance<2) return ResponseModel::err(7002);
254
+        if ($clearance<2) {
255
+            return ResponseModel::err(7002);
256
+        }
253 257
         $targetClearance=$groupModel->judgeEmailClearance($all_data["gid"], $all_data["email"]);
254
-        if ($targetClearance!=-3) return ResponseModel::err(7003);
258
+        if ($targetClearance!=-3) {
259
+            return ResponseModel::err(7003);
260
+        }
255 261
         $groupModel->inviteMember($all_data["gid"], $all_data["email"]);
256 262
         $basic=$groupModel->basic($all_data['gid']);
257 263
         $url=route('group.detail', ['gcode' => $basic['gcode']]);
Please login to merge, or discard this patch.