Passed
Pull Request — master (#88)
by Chenyi
04:29
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/Babel/Judger/Judge.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -396,7 +396,9 @@
 block discarded – undo
396 396
     private function get_last_uva($earliest)
397 397
     {
398 398
         $ret=[];
399
-        if (!$earliest) return $ret;
399
+        if (!$earliest) {
400
+            return $ret;
401
+        }
400 402
 
401 403
         $judger=new JudgerModel();
402 404
         $judgerDetail=$judger->detail($earliest['jid']);
Please login to merge, or discard this patch.
app/Models/ContestModel.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                 ->where(
153 153
                     function ($query) {
154 154
                         $query->where('public', 1)
155
-                              ->where('audit', 1);
155
+                                ->where('audit', 1);
156 156
                     }
157 157
                 )
158 158
                 ->orWhere(
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
                                 ->where('group_member.role', '>', 0)
162 162
                                 ->where(function ($query) use ($uid) {
163 163
                                     $query->where('contest_participant.uid', $uid)
164
-                                          ->orWhereNull('contest_participant.uid');
164
+                                            ->orWhereNull('contest_participant.uid');
165 165
                                 })
166
-                              ->where(function ($query) {
167
-                                  $query->where('registration', 0)
166
+                                ->where(function ($query) {
167
+                                    $query->where('registration', 0)
168 168
                                                 ->orWhere(function ($query) {
169 169
                                                     $query->where('registration', 1)
170
-                                                          ->whereNotNull('contest_participant.uid');
170
+                                                            ->whereNotNull('contest_participant.uid');
171 171
                                                 });
172
-                              });
172
+                                });
173 173
                     }
174 174
                 )
175 175
                 ->orderBy('contest.begin_time', 'desc')
Please login to merge, or discard this patch.
app/Models/JudgerModel.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,9 @@
 block discarded – undo
61 61
     {
62 62
         $curl=curl_init();
63 63
 
64
-        if($curl===false) return [];
64
+        if($curl===false) {
65
+            return [];
66
+        }
65 67
 
66 68
         curl_setopt_array($curl, array(
67 69
             CURLOPT_PORT => $port,
Please login to merge, or discard this patch.
app/Babel/Crawler/Crawler.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,6 +40,8 @@
 block discarded – undo
40 40
         if ($name=="UVa") {
41 41
             $crawler=new UVa($action, $con, $cached);
42 42
         }
43
-        if (isset($crawler)) $this->data=$crawler->data;
43
+        if (isset($crawler)) {
44
+            $this->data=$crawler->data;
45
+        }
44 46
     }
45 47
 }
Please login to merge, or discard this patch.
app/Models/Rating/RatingCalculator.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
             $mid = floor(($right + $left)/2);
79 79
             if($this->getSeed($mid) < $rank){
80 80
                 $right = $mid;
81
-            }else{
81
+            } else{
82 82
                 $left = $mid;
83 83
             }
84 84
         }
Please login to merge, or discard this patch.
app/Models/RankModel.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,13 +64,17 @@  discard block
 block discarded – undo
64 64
 
65 65
     public static function getColor($rankTitle)
66 66
     {
67
-        if(is_null($rankTitle)) return "";
67
+        if(is_null($rankTitle)) {
68
+            return "";
69
+        }
68 70
         return self::$casualRanking[$rankTitle];
69 71
     }
70 72
 
71 73
     public static function getProfessionalColor($rankTitle)
72 74
     {
73
-        if(is_null($rankTitle)) return self::$professionalRanking["None"];
75
+        if(is_null($rankTitle)) {
76
+            return self::$professionalRanking["None"];
77
+        }
74 78
         return self::$professionalRanking[$rankTitle];
75 79
     }
76 80
 
@@ -165,7 +169,9 @@  discard block
 block discarded – undo
165 169
     private function getRankTitle($rankVal)
166 170
     {
167 171
         foreach($this->casualRankingPer as $title=>$c){
168
-            if($rankVal<=$c) return $title;
172
+            if($rankVal<=$c) {
173
+                return $title;
174
+            }
169 175
         }
170 176
         return Arr::last($this->casualRankingPer);
171 177
     }
@@ -173,7 +179,9 @@  discard block
 block discarded – undo
173 179
     private function getProfessionalTitle($rankVal)
174 180
     {
175 181
         foreach($this->professionalRankingPer as $title=>$point) {
176
-            if($rankVal >= $point) return $title;
182
+            if($rankVal >= $point) {
183
+                return $title;
184
+            }
177 185
         }
178 186
         return Arr::last($this->professionalRankingPer);
179 187
     }
Please login to merge, or discard this patch.