Passed
Push — master ( a9d1f9...e92e16 )
by John
04:09
created
app/Models/Search/ProblemSearchModel.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,20 +13,20 @@
 block discarded – undo
13 13
 
14 14
     public function search($key)
15 15
     {
16
-        $result = [];
17
-        if(strlen($key) >= 2){
18
-            $ret = self::where('pcode', $key)
19
-                ->orWhereRaw('MATCH(`title`) AGAINST (? IN BOOLEAN MODE)',[$key])
16
+        $result=[];
17
+        if (strlen($key)>=2) {
18
+            $ret=self::where('pcode', $key)
19
+                ->orWhereRaw('MATCH(`title`) AGAINST (? IN BOOLEAN MODE)', [$key])
20 20
                 ->select('pcode', 'title')
21 21
                 ->limit(120)
22 22
                 ->get()->all();
23
-            if(!empty($ret)){
24
-                $result += $ret;
23
+            if (!empty($ret)) {
24
+                $result+=$ret;
25 25
             }
26 26
         }
27
-        $problemModel = new ProblemModel();
27
+        $problemModel=new ProblemModel();
28 28
         foreach ($result as $p_index => $p) {
29
-            if($problemModel->isBlocked($p['pid']) || $problemModel->isHidden($p["pid"])){
29
+            if ($problemModel->isBlocked($p['pid']) || $problemModel->isHidden($p["pid"])) {
30 30
                 unset($result[$p_index]);
31 31
             }
32 32
         }
Please login to merge, or discard this patch.
app/Admin/Controllers/SubmissionController.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
         $grid->coid("COID");
98 98
         $grid->score("Raw Score");
99 99
         $grid->filter(function(Grid\Filter $filter) {
100
-            $filter->column(6, function ($filter) {
100
+            $filter->column(6, function($filter) {
101 101
                 $filter->like('verdict');
102 102
             });
103
-            $filter->column(6, function ($filter) {
103
+            $filter->column(6, function($filter) {
104 104
                 $filter->equal('cid', 'Contest ID');
105 105
                 $filter->equal('uid', 'User ID');
106 106
                 $filter->equal('pid', 'Problem ID');
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
         $show->language();
127 127
         $show->submission_date();
128 128
         $show->remote_id();
129
-        $this->codify($show->solution(),$show->getModel()->compiler->lang);
130
-        if(!blank($show->getModel()->compile_info))$this->codify($show->compile_info());
129
+        $this->codify($show->solution(), $show->getModel()->compiler->lang);
130
+        if (!blank($show->getModel()->compile_info))$this->codify($show->compile_info());
131 131
         $show->uid('UID');
132 132
         $show->pid('PID');
133 133
         $show->cid('CID');
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
139 139
         return $show;
140 140
     }
141 141
 
142
-    private function codify($field, $lang=null){
143
-        $field->unescape()->as(function ($value) use ($field,$lang) {
144
-            $field->border = false;
145
-            if($value===null || $value==="") $value=" ";
142
+    private function codify($field, $lang=null) {
143
+        $field->unescape()->as(function($value) use ($field, $lang) {
144
+            $field->border=false;
145
+            if ($value===null || $value==="") $value=" ";
146 146
             return "
147 147
                 <style>
148 148
                 #x".md5($value)." {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -127,7 +127,9 @@  discard block
 block discarded – undo
127 127
         $show->submission_date();
128 128
         $show->remote_id();
129 129
         $this->codify($show->solution(),$show->getModel()->compiler->lang);
130
-        if(!blank($show->getModel()->compile_info))$this->codify($show->compile_info());
130
+        if(!blank($show->getModel()->compile_info)) {
131
+            $this->codify($show->compile_info());
132
+        }
131 133
         $show->uid('UID');
132 134
         $show->pid('PID');
133 135
         $show->cid('CID');
@@ -142,7 +144,9 @@  discard block
 block discarded – undo
142 144
     private function codify($field, $lang=null){
143 145
         $field->unescape()->as(function ($value) use ($field,$lang) {
144 146
             $field->border = false;
145
-            if($value===null || $value==="") $value=" ";
147
+            if($value===null || $value==="") {
148
+                $value=" ";
149
+            }
146 150
             return "
147 151
                 <style>
148 152
                 #x".md5($value)." {
Please login to merge, or discard this patch.