Completed
Push — master ( 289dbc...0efbaa )
by Scott
02:23
created
models/Category.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
      */
156 156
     protected function deleteRelatedFilters(array $filters)
157 157
     {
158
-        return array_filter($filters, function ($filter) {
158
+        return array_filter($filters, function($filter) {
159 159
             if ($filter['id'] !== null && $filter['is_deleted']) {
160 160
                 Filter::find($filter['id'])->delete();
161 161
             }
162 162
 
163
-            return ! $filter['is_deleted'];
163
+            return !$filter['is_deleted'];
164 164
         });
165 165
     }
166 166
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 
211 211
     public static function getParentIds($children, \October\Rain\Database\Collection $categories = null)
212 212
     {
213
-        if (! is_array($children)) {
213
+        if (!is_array($children)) {
214 214
             $children = [$children];
215 215
         }
216 216
 
@@ -220,13 +220,13 @@  discard block
 block discarded – undo
220 220
 
221 221
         $parents = [];
222 222
         foreach ($children as $child) {
223
-            $category = $categories->filter(function ($model) use ($child) {
223
+            $category = $categories->filter(function($model) use ($child) {
224 224
                 return $model->id == $child;
225 225
             })->first();
226 226
 
227 227
             while ($category && $category->parent_id) {
228 228
                 $parents[] = $category->parent_id;
229
-                $category = $categories->filter(function ($model) use ($category) {
229
+                $category = $categories->filter(function($model) use ($category) {
230 230
                     return $model->id == $category->parent_id;
231 231
                 })->first();
232 232
             }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      */
259 259
     public function isCustomSorted()
260 260
     {
261
-        return ! $this->product_sort_column && ! $this->product_sort_direction;
261
+        return !$this->product_sort_column && !$this->product_sort_direction;
262 262
     }
263 263
 
264 264
     /**
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     {
271 271
         $filters = $this->getOriginalPurgeValue('category_filters');
272 272
 
273
-        if (is_array($filters) && ! empty($filters)) {
273
+        if (is_array($filters) && !empty($filters)) {
274 274
             $filters = $this->deleteRelatedFilters($filters);
275 275
             $this->saveRelatedFilters($filters);
276 276
         }
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
      */
373 373
     protected function setNullParentId()
374 374
     {
375
-        if (! $this->parent_id) {
375
+        if (!$this->parent_id) {
376 376
             $this->parent_id = null;
377 377
         }
378 378
     }
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
      */
414 414
     public function syncInheritedProductsAfterDelete()
415 415
     {
416
-        if (! $this->dontSyncAfterDelete) {
416
+        if (!$this->dontSyncAfterDelete) {
417 417
             Product::syncAllInheritedCategories();
418 418
         }
419 419
     }
Please login to merge, or discard this patch.
classes/ProductsQuery.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * @param  \October\Rain\Database\Builder   $products
50 50
      * @return void
51 51
      */
52
-    protected function applyCustomOrder(Builder &$query)
52
+    protected function applyCustomOrder(Builder & $query)
53 53
     {
54 54
         $order = '';
55 55
         foreach ($this->category->product_order as $index => $id) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @param  \October\Rain\Database\Builder   $products
66 66
      * @return void
67 67
      */
68
-    protected function applyOrderByStatements(Builder &$query)
68
+    protected function applyOrderByStatements(Builder & $query)
69 69
     {
70 70
         if (array_key_exists('products_sort_column', $this->params) &&
71 71
             array_key_exists('products_sort_direction', $this->params)) {
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
      * @param  \October\Rain\Database\Builder   $query
84 84
      * @return void
85 85
      */
86
-    protected function applyProductFilters(Builder &$query)
86
+    protected function applyProductFilters(Builder & $query)
87 87
     {
88
-        $query->where(function ($q) {
88
+        $query->where(function($q) {
89 89
             foreach ($this->category->filters as $filter) {
90 90
                 $right = $filter->getRightClause();
91 91
                 $q->where($filter->left, $filter->comparator, $right);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      * @param  \October\Rain\Database\Builder   $query
100 100
      * @return void
101 101
      */
102
-    protected function applySelectStatements(Builder &$query)
102
+    protected function applySelectStatements(Builder & $query)
103 103
     {
104 104
         // apply select statements if neccessary
105 105
         if (array_key_exists('products_select', $this->params) && $this->params['products_select']) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      * @param  \October\Rain\Database\Builder   $query
119 119
      * @return void
120 120
      */
121
-    protected function applyWhereStatements(Builder &$query)
121
+    protected function applyWhereStatements(Builder & $query)
122 122
     {
123 123
         // if the category is filtered, grab our products from those
124 124
         if ($this->category->isFiltered()) {
Please login to merge, or discard this patch.