Passed
Push — master ( e2ac82...cbaa14 )
by John
06:23 queued 11s
created
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/Admin/Controllers/ApiController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,21 +10,21 @@  discard block
 block discarded – undo
10 10
 
11 11
 class ApiController extends AdminController
12 12
 {
13
-    protected function paginate($items, $perPage = 15, $pageStart = 1)
13
+    protected function paginate($items, $perPage=15, $pageStart=1)
14 14
     {
15
-        $offSet = ($pageStart * $perPage) - $perPage;
16
-        $itemsForCurrentPage = array_slice($items, $offSet, $perPage, true);
17
-        $paginator = new LengthAwarePaginator($itemsForCurrentPage, count($items), $perPage, Paginator::resolveCurrentPage(), ['path' => Paginator::resolveCurrentPath()]);
15
+        $offSet=($pageStart * $perPage)-$perPage;
16
+        $itemsForCurrentPage=array_slice($items, $offSet, $perPage, true);
17
+        $paginator=new LengthAwarePaginator($itemsForCurrentPage, count($items), $perPage, Paginator::resolveCurrentPage(), ['path' => Paginator::resolveCurrentPath()]);
18 18
         return $paginator;
19 19
     }
20 20
 
21 21
     public function problems()
22 22
     {
23
-        $q = request()->q;
23
+        $q=request()->q;
24 24
 
25
-        return $this->paginate(Problem::orderBy('pcode', 'asc')->get()->filter(function ($problem) use ($q) {
26
-            return stripos($problem->readable_name, $q) !== false;
27
-        })->values()->transform(function ($problem) {
25
+        return $this->paginate(Problem::orderBy('pcode', 'asc')->get()->filter(function($problem) use ($q) {
26
+            return stripos($problem->readable_name, $q)!==false;
27
+        })->values()->transform(function($problem) {
28 28
             return [
29 29
                 'id' => $problem->pid,
30 30
                 'text' => $problem->readable_name,
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function users()
36 36
     {
37
-        $q = request()->q;
37
+        $q=request()->q;
38 38
 
39
-        return $this->paginate(User::get()->filter(function ($user) use ($q) {
40
-            return stripos($user->readable_name, $q) !== false;
41
-        })->values()->transform(function ($user) {
39
+        return $this->paginate(User::get()->filter(function($user) use ($q) {
40
+            return stripos($user->readable_name, $q)!==false;
41
+        })->values()->transform(function($user) {
42 42
             return [
43 43
                 'id' => $user->id,
44 44
                 'text' => $user->readable_name,
Please login to merge, or discard this patch.