@@ -159,12 +159,12 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | protected function deleteRelatedInventories($inventories) |
| 161 | 161 | { |
| 162 | - return array_filter($inventories, function ($inventory) { |
|
| 162 | + return array_filter($inventories, function($inventory) { |
|
| 163 | 163 | if ($inventory['id'] !== null && $inventory['is_deleted']) { |
| 164 | 164 | Inventory::find($inventory['id'])->delete(); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - return ! $inventory['is_deleted']; |
|
| 167 | + return !$inventory['is_deleted']; |
|
| 168 | 168 | }); |
| 169 | 169 | } |
| 170 | 170 | |
@@ -176,12 +176,12 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | protected function deleteRelatedOptions($options) |
| 178 | 178 | { |
| 179 | - return array_filter($options, function ($option) { |
|
| 179 | + return array_filter($options, function($option) { |
|
| 180 | 180 | if ($option['id'] !== null && $option['is_deleted']) { |
| 181 | 181 | Option::find($option['id'])->delete(); |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - return ! $option['is_deleted']; |
|
| 184 | + return !$option['is_deleted']; |
|
| 185 | 185 | }); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -193,12 +193,12 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | protected function deleteRelatedOptionValues($optionValues) |
| 195 | 195 | { |
| 196 | - return array_filter($optionValues, function ($optionValue) { |
|
| 196 | + return array_filter($optionValues, function($optionValue) { |
|
| 197 | 197 | if ($optionValue['id'] !== null && $optionValue['is_deleted']) { |
| 198 | 198 | OptionValue::find($optionValue['id'])->delete(); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - return ! $optionValue['is_deleted']; |
|
| 201 | + return !$optionValue['is_deleted']; |
|
| 202 | 202 | }); |
| 203 | 203 | } |
| 204 | 204 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | * @param string $sessionKey |
| 331 | 331 | * @return void |
| 332 | 332 | */ |
| 333 | - protected function saveRelatedOptionValues(Option &$option, array $values, $sessionKey) |
|
| 333 | + protected function saveRelatedOptionValues(Option & $option, array $values, $sessionKey) |
|
| 334 | 334 | { |
| 335 | 335 | foreach ($values as $index => $value) { |
| 336 | 336 | $model = array_key_exists('id', $value) && $value['id'] !== null |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | */ |
| 384 | 384 | public static function syncAllInheritedCategories() |
| 385 | 385 | { |
| 386 | - Queue::push(function ($job) { |
|
| 386 | + Queue::push(function($job) { |
|
| 387 | 387 | $data = []; |
| 388 | 388 | $products = Product::with('categories')->get(); |
| 389 | 389 | $categoryTree = Category::getParentCategoryIds(); |
@@ -446,8 +446,8 @@ discard block |
||
| 446 | 446 | */ |
| 447 | 447 | protected function validateInventories() |
| 448 | 448 | { |
| 449 | - if (! is_array($this->optionsInventories) || |
|
| 450 | - ! is_array($this->optionsInventories['options'])) { |
|
| 449 | + if (!is_array($this->optionsInventories) || |
|
| 450 | + !is_array($this->optionsInventories['options'])) { |
|
| 451 | 451 | return; |
| 452 | 452 | } |
| 453 | 453 | |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | sort($inventory['valueIds']); |
| 462 | 462 | $valueCombination = json_encode($inventory['valueIds']); |
| 463 | 463 | |
| 464 | - if (in_array($valueCombination, $takenValueCombinations) && ! $inventory['is_deleted']) { |
|
| 464 | + if (in_array($valueCombination, $takenValueCombinations) && !$inventory['is_deleted']) { |
|
| 465 | 465 | Flash::error(Lang::get('bedard.shop::lang.products.form.duplicate_inventories_error')); |
| 466 | 466 | throw new ModelException($this); |
| 467 | 467 | } |
@@ -478,8 +478,8 @@ discard block |
||
| 478 | 478 | */ |
| 479 | 479 | protected function validateOptions() |
| 480 | 480 | { |
| 481 | - if (! is_array($this->optionsInventories) || |
|
| 482 | - ! is_array($this->optionsInventories['options'])) { |
|
| 481 | + if (!is_array($this->optionsInventories) || |
|
| 482 | + !is_array($this->optionsInventories['options'])) { |
|
| 483 | 483 | return; |
| 484 | 484 | } |
| 485 | 485 | |
@@ -91,11 +91,11 @@ |
||
| 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 | } |
@@ -8,7 +8,7 @@ |
||
| 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(); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public function validate() |
| 19 | 19 | { |
| 20 | 20 | $data = input('option'); |
| 21 | - if (! $data || ! is_array($data)) { |
|
| 21 | + if (!$data || !is_array($data)) { |
|
| 22 | 22 | return Response::make('Error', 422); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -155,12 +155,12 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | $query = Category::isActive(); |
| 17 | 17 | |
| 18 | - if (array_key_exists('select', $params) && is_array($params['select']) && ! empty($params['select'])) { |
|
| 18 | + if (array_key_exists('select', $params) && is_array($params['select']) && !empty($params['select'])) { |
|
| 19 | 19 | $query->select($params['select']); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $loadProducts = array_key_exists('load_products', $params) && $params['load_products']; |
| 51 | 51 | if ($loadProducts) { |
| 52 | - $category->load(['products' => function ($products) use ($category, $params) { |
|
| 52 | + $category->load(['products' => function($products) use ($category, $params) { |
|
| 53 | 53 | if (array_key_exists('products_select', $params) && $params['products_select']) { |
| 54 | 54 | $products->select($params['products_select']); |
| 55 | 55 | |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - if (! is_null($category->product_sort_column) && |
|
| 62 | - ! is_null($category->product_sort_direction)) { |
|
| 61 | + if (!is_null($category->product_sort_column) && |
|
| 62 | + !is_null($category->product_sort_direction)) { |
|
| 63 | 63 | $products->orderBy($category->product_sort_column, $category->product_sort_direction); |
| 64 | 64 | } |
| 65 | 65 | }]); |