@@ -20,7 +20,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -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 | } |
@@ -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 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function show($slug, array $params = []) |
| 42 | 42 | { |
| 43 | - if (! array_key_exists('select', $params) || ! is_array($params['select']) || empty($params['select'])) { |
|
| 43 | + if (!array_key_exists('select', $params) || !is_array($params['select']) || empty($params['select'])) { |
|
| 44 | 44 | throw new Exception('Category show() must select at least one column.'); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | ->firstOrFail(); |
| 51 | 51 | |
| 52 | 52 | if ($params['load_products']) { |
| 53 | - $category->load(['products' => function ($products) use ($category, $params) { |
|
| 54 | - if (! array_key_exists('products_select', $params) || |
|
| 55 | - ! is_array($params['products_select']) || |
|
| 53 | + $category->load(['products' => function($products) use ($category, $params) { |
|
| 54 | + if (!array_key_exists('products_select', $params) || |
|
| 55 | + !is_array($params['products_select']) || |
|
| 56 | 56 | empty($params['products_select'])) { |
| 57 | 57 | throw new Exception('Category show() products must select at least one column.'); |
| 58 | 58 | } |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $products->select($params['products_select']); |
| 65 | 65 | |
| 66 | - if (! is_null($category->product_sort_column) && |
|
| 67 | - ! is_null($category->product_sort_direction)) { |
|
| 66 | + if (!is_null($category->product_sort_column) && |
|
| 67 | + !is_null($category->product_sort_direction)) { |
|
| 68 | 68 | $products->orderBy($category->product_sort_column, $category->product_sort_direction); |
| 69 | 69 | } |
| 70 | 70 | }]); |
@@ -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(); |