Completed
Push — master ( 20ff1e...685fd1 )
by Scott
02:31
created
updates/1.0/create_inventory_option_values_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function up()
10 10
     {
11
-        Schema::create('bedard_shop_inventory_option_values', function (Blueprint $table) {
11
+        Schema::create('bedard_shop_inventory_option_values', function(Blueprint $table) {
12 12
             $table->engine = 'InnoDB';
13 13
             $table->integer('inventory_id')->unsigned();
14 14
             $table->integer('option_value_id')->unsigned();
Please login to merge, or discard this patch.
controllers/Options.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public function create()
21 21
     {
22 22
         $data = input('option');
23
-        if (! $data || ! is_array($data)) {
23
+        if (!$data || !is_array($data)) {
24 24
             return Response::make('Error', 422);
25 25
         }
26 26
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function createValue()
45 45
     {
46 46
         $data = input('value');
47
-        if (! $data || ! is_array($data)) {
47
+        if (!$data || !is_array($data)) {
48 48
             return Response::make('Error', 422);
49 49
         }
50 50
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function validate()
69 69
     {
70 70
         $data = input('option');
71
-        if (! $data || ! is_array($data)) {
71
+        if (!$data || !is_array($data)) {
72 72
             return Response::make('Error', 422);
73 73
         }
74 74
 
Please login to merge, or discard this patch.
models/Inventory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,11 +91,11 @@
 block discarded – undo
91 91
      */
92 92
     public function scopeHasOptionValueIds($query, $ids)
93 93
     {
94
-        if (! is_array($ids)) {
94
+        if (!is_array($ids)) {
95 95
             $ids = [$ids];
96 96
         }
97 97
 
98
-        return $query->whereHas('optionValues', function ($optionValue) use ($ids) {
98
+        return $query->whereHas('optionValues', function($optionValue) use ($ids) {
99 99
             return $optionValue->whereIn('id', $ids);
100 100
         });
101 101
     }
Please login to merge, or discard this patch.
updates/1.0/create_filters_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function up()
10 10
     {
11
-        Schema::create('bedard_shop_filters', function (Blueprint $table) {
11
+        Schema::create('bedard_shop_filters', function(Blueprint $table) {
12 12
             $table->engine = 'InnoDB';
13 13
             $table->increments('id');
14 14
             $table->integer('category_id')->unsigned()->index();
Please login to merge, or discard this patch.
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.
models/Product.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
      */
168 168
     protected function deleteRelatedInventories($inventories)
169 169
     {
170
-        return array_filter($inventories, function ($inventory) {
170
+        return array_filter($inventories, function($inventory) {
171 171
             if ($inventory['id'] !== null && $inventory['is_deleted']) {
172 172
                 Inventory::find($inventory['id'])->delete();
173 173
             }
174 174
 
175
-            return ! $inventory['is_deleted'];
175
+            return !$inventory['is_deleted'];
176 176
         });
177 177
     }
178 178
 
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
      */
185 185
     protected function deleteRelatedOptions(array $options)
186 186
     {
187
-        return array_filter($options, function ($option) {
187
+        return array_filter($options, function($option) {
188 188
             if ($option['id'] !== null && $option['is_deleted']) {
189 189
                 Option::find($option['id'])->delete();
190 190
             }
191 191
 
192
-            return ! $option['is_deleted'];
192
+            return !$option['is_deleted'];
193 193
         });
194 194
     }
195 195
 
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
      */
202 202
     protected function deleteRelatedOptionValues(array $optionValues)
203 203
     {
204
-        return array_filter($optionValues, function ($optionValue) {
204
+        return array_filter($optionValues, function($optionValue) {
205 205
             if ($optionValue['id'] !== null && $optionValue['is_deleted']) {
206 206
                 OptionValue::find($optionValue['id'])->delete();
207 207
             }
208 208
 
209
-            return ! $optionValue['is_deleted'];
209
+            return !$optionValue['is_deleted'];
210 210
         });
211 211
     }
212 212
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
      * @param  string $sessionKey
339 339
      * @return void
340 340
      */
341
-    protected function saveRelatedOptionValues(Option &$option, array $values, $sessionKey)
341
+    protected function saveRelatedOptionValues(Option & $option, array $values, $sessionKey)
342 342
     {
343 343
         foreach ($values as $index => $value) {
344 344
             $model = array_key_exists('id', $value) && $value['id'] !== null
@@ -362,10 +362,10 @@  discard block
 block discarded – undo
362 362
      */
363 363
     public function scopeAppearingInCategory(Builder $query, $categoryId)
364 364
     {
365
-        return $query->where(function ($q) use ($categoryId) {
366
-            return $q->whereHas('categories', function ($category) use ($categoryId) {
365
+        return $query->where(function($q) use ($categoryId) {
366
+            return $q->whereHas('categories', function($category) use ($categoryId) {
367 367
                 $category->whereId($categoryId);
368
-            })->orWhereHas('inherited_categories', function ($category) use ($categoryId) {
368
+            })->orWhereHas('inherited_categories', function($category) use ($categoryId) {
369 369
                 $category->whereId($categoryId);
370 370
             });
371 371
         });
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
      */
482 482
     public static function syncAllInheritedCategories()
483 483
     {
484
-        Queue::push(function ($job) {
484
+        Queue::push(function($job) {
485 485
             $data = [];
486 486
             $products = Product::with('categories')->get();
487 487
             $categoryTree = Category::getParentCategoryIds();
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
      */
545 545
     protected function validateInventories()
546 546
     {
547
-        if (! is_array($this->optionsInventories) ||
548
-            ! is_array($this->optionsInventories['options'])) {
547
+        if (!is_array($this->optionsInventories) ||
548
+            !is_array($this->optionsInventories['options'])) {
549 549
             return;
550 550
         }
551 551
 
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
             sort($inventory['valueIds']);
560 560
             $valueCombination = json_encode($inventory['valueIds']);
561 561
 
562
-            if (in_array($valueCombination, $takenValueCombinations) && ! $inventory['is_deleted']) {
562
+            if (in_array($valueCombination, $takenValueCombinations) && !$inventory['is_deleted']) {
563 563
                 Flash::error(Lang::get('bedard.shop::lang.products.form.duplicate_inventories_error'));
564 564
                 throw new ModelException($this);
565 565
             }
@@ -576,8 +576,8 @@  discard block
 block discarded – undo
576 576
      */
577 577
     protected function validateOptions()
578 578
     {
579
-        if (! is_array($this->optionsInventories) ||
580
-            ! is_array($this->optionsInventories['options'])) {
579
+        if (!is_array($this->optionsInventories) ||
580
+            !is_array($this->optionsInventories['options'])) {
581 581
             return;
582 582
         }
583 583
 
Please login to merge, or discard this patch.
classes/ProductsQuery.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     protected function applyCustomOrder()
58 58
     {
59 59
         $this->query
60
-            ->join('bedard_shop_category_product', function ($join) {
60
+            ->join('bedard_shop_category_product', function($join) {
61 61
                 $join->on('bedard_shop_products.id', '=', 'bedard_shop_category_product.product_id')
62 62
                     ->where('bedard_shop_category_product.category_id', '=', $this->category->id);
63 63
             })
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     protected function applyProductFilters()
107 107
     {
108
-        $this->query->where(function ($q) {
108
+        $this->query->where(function($q) {
109 109
             foreach ($this->category->filters as $filter) {
110 110
                 $right = $filter->getRightClause();
111 111
                 $q->where($filter->left, $filter->comparator, $right);
Please login to merge, or discard this patch.
updates/1.0/create_orders_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function up()
10 10
     {
11
-        Schema::create('bedard_shop_orders', function (Blueprint $table) {
11
+        Schema::create('bedard_shop_orders', function(Blueprint $table) {
12 12
             $table->engine = 'InnoDB';
13 13
             $table->increments('id');
14 14
             $table->timestamps();
Please login to merge, or discard this patch.
updates/1.0/create_cart_items_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function up()
10 10
     {
11
-        Schema::create('bedard_shop_cart_items', function (Blueprint $table) {
11
+        Schema::create('bedard_shop_cart_items', function(Blueprint $table) {
12 12
             $table->engine = 'InnoDB';
13 13
             $table->increments('id');
14 14
             $table->integer('cart_id')->unsigned()->index();
Please login to merge, or discard this patch.