Passed
Push — master ( 0d336d...0079b2 )
by Hossein
01:28 queued 11s
created
src/Contracts/QueryFilter.php 1 patch
Braces   +12 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function builder(Builder $query)
36 36
     {
37
-        if (is_null($this->filters))
38
-            return $query;
37
+        if (is_null($this->filters)) {
38
+                    return $query;
39
+        }
39 40
         foreach ($this->filters as $filter) {
40 41
             if (is_array($filter[1])) {
41 42
                 $query = $query->whereBetween($filter[0], $filter[1]);
@@ -65,13 +66,15 @@  discard block
 block discarded – undo
65 66
      */
66 67
     private function requestParser($request)
67 68
     {
68
-        if (empty($request))
69
-            return;
69
+        if (empty($request)) {
70
+                    return;
71
+        }
70 72
 
71
-        if (strpos('asd', array_keys($request)[0]) || strpos('desc', array_keys($request)[0]))
72
-            list($filterString, $this->sort) = explode(',', array_keys($request)[0]);
73
-        else
74
-            $filterString = array_keys($request)[0];
73
+        if (strpos('asd', array_keys($request)[0]) || strpos('desc', array_keys($request)[0])) {
74
+                    list($filterString, $this->sort) = explode(',', array_keys($request)[0]);
75
+        } else {
76
+                    $filterString = array_keys($request)[0];
77
+        }
75 78
 
76 79
         $conditions = explode('|', $filterString);
77 80
 
@@ -110,8 +113,7 @@  discard block
 block discarded – undo
110 113
                     $filters[$current][1] = explode('-', $filter[1]);
111 114
                 }
112 115
                 $current++;
113
-            }
114
-            else {
116
+            } else {
115 117
                 unset($filters[$current]);
116 118
                 $current++;
117 119
             }
Please login to merge, or discard this patch.
src/Traits/Filterable.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,9 +16,10 @@
 block discarded – undo
16 16
      */
17 17
     public function scopeFilter($query, $filter)
18 18
     {
19
-        if (is_string($filter))
20
-            return getInstanceFilter($filter)->builder($query);
21
-        elseif ($filter instanceof QueryFilter)
22
-            return $filter->builder($query);
19
+        if (is_string($filter)) {
20
+                    return getInstanceFilter($filter)->builder($query);
21
+        } elseif ($filter instanceof QueryFilter) {
22
+                    return $filter->builder($query);
23
+        }
23 24
     }
24 25
 }
25 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/Helpers/filter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('filter')) {
3
+if (!function_exists('filter')) {
4 4
     /**
5 5
      * Get the available filter instance.
6 6
      *
Please login to merge, or discard this patch.
src/Commands/FilterMakeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
      */
83 83
     protected function replaceClass($stub, $name)
84 84
     {
85
-        $class = str_replace($this->getNamespace($name).'\\', '', $name);
85
+        $class = str_replace($this->getNamespace($name) . '\\', '', $name);
86 86
 
87 87
         return str_replace('DummyFilter', $class, $stub);
88 88
     }
Please login to merge, or discard this patch.
src/Providers/FilterServiceProvider.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 class FilterServiceProvider extends ServiceProvider
8 8
 {
9 9
     protected $commands = [
10
-      'HChamran\LaravelFilter\Commands\FilterMakeCommand'
10
+        'HChamran\LaravelFilter\Commands\FilterMakeCommand'
11 11
     ];
12 12
 
13 13
     /**
Please login to merge, or discard this patch.