@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('bedard_shop_category_product', function (Blueprint $table) { |
|
| 11 | + Schema::create('bedard_shop_category_product', function(Blueprint $table) { |
|
| 12 | 12 | $table->engine = 'InnoDB'; |
| 13 | 13 | $table->integer('category_id')->unsigned()->nullable(); |
| 14 | 14 | $table->integer('product_id')->unsigned()->nullable(); |
@@ -8,7 +8,7 @@ |
||
| 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(); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('bedard_shop_options', function (Blueprint $table) { |
|
| 11 | + Schema::create('bedard_shop_options', function(Blueprint $table) { |
|
| 12 | 12 | $table->engine = 'InnoDB'; |
| 13 | 13 | $table->increments('id'); |
| 14 | 14 | $table->integer('product_id')->unsigned()->nullable()->index(); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | { |
| 41 | 41 | $self = $this->getTable().'.*'; |
| 42 | 42 | |
| 43 | - if (! in_array($self, $query->getQuery()->columns)) { |
|
| 43 | + if (!in_array($self, $query->getQuery()->columns)) { |
|
| 44 | 44 | $query->addSelect($self); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * Construct. |
| 14 | 14 | * |
| 15 | - * @return void |
|
| 15 | + * @return string |
|
| 16 | 16 | */ |
| 17 | 17 | public function __construct() |
| 18 | 18 | { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $drivers = []; |
| 30 | 30 | |
| 31 | 31 | foreach ($this->manager->getPlugins() as $id => $plugin) { |
| 32 | - if (! method_exists($plugin, 'registerShopDrivers')) { |
|
| 32 | + if (!method_exists($plugin, 'registerShopDrivers')) { |
|
| 33 | 33 | continue; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function getDriversByType($type) |
| 55 | 55 | { |
| 56 | - return array_filter($this->getDrivers(), function ($driver) use ($type) { |
|
| 56 | + return array_filter($this->getDrivers(), function($driver) use ($type) { |
|
| 57 | 57 | return $driver['type'] === $type; |
| 58 | 58 | }); |
| 59 | 59 | } |
@@ -292,7 +292,7 @@ |
||
| 292 | 292 | /** |
| 293 | 293 | * Save an item and sync the cart. |
| 294 | 294 | * |
| 295 | - * @param \Bedard\Shop\Models\Item $item |
|
| 295 | + * @param Inventory $item |
|
| 296 | 296 | * @return \Bedard\Shop\Models\Item |
| 297 | 297 | */ |
| 298 | 298 | public function saveItem($item) |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | 'product_id' => $inventory->product_id, |
| 196 | 196 | ]); |
| 197 | 197 | |
| 198 | - $item->bindEvent('model.beforeSave', function () use ($inventory, $item) { |
|
| 198 | + $item->bindEvent('model.beforeSave', function() use ($inventory, $item) { |
|
| 199 | 199 | if ($item->quantity > $inventory->quantity) { |
| 200 | 200 | $item->quantity = $inventory->quantity; |
| 201 | 201 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public static function processAbandoned() |
| 233 | 233 | { |
| 234 | - self::isAbandoned()->get()->each(function ($cart) { |
|
| 234 | + self::isAbandoned()->get()->each(function($cart) { |
|
| 235 | 235 | $cart->abandon(); |
| 236 | 236 | }); |
| 237 | 237 | } |
@@ -244,10 +244,10 @@ discard block |
||
| 244 | 244 | public function reduceAvailableInventory() |
| 245 | 245 | { |
| 246 | 246 | $id = $this->id; |
| 247 | - Queue::push(function ($job) use ($id) { |
|
| 247 | + Queue::push(function($job) use ($id) { |
|
| 248 | 248 | $cart = Cart::with('items.inventory')->findOrFail($id); |
| 249 | 249 | |
| 250 | - $cart->items->each(function ($item) { |
|
| 250 | + $cart->items->each(function($item) { |
|
| 251 | 251 | $item->reduceAvailableInventory(); |
| 252 | 252 | }); |
| 253 | 253 | }); |
@@ -280,9 +280,9 @@ discard block |
||
| 280 | 280 | public function restockInventories() |
| 281 | 281 | { |
| 282 | 282 | $id = $this->id; |
| 283 | - Queue::push(function ($job) use ($id) { |
|
| 283 | + Queue::push(function($job) use ($id) { |
|
| 284 | 284 | $cart = Cart::with('items.inventory')->findOrFail($id); |
| 285 | - $cart->items->each(function ($item) { |
|
| 285 | + $cart->items->each(function($item) { |
|
| 286 | 286 | $item->inventory->quantity += $item->quantity; |
| 287 | 287 | $item->inventory->save(); |
| 288 | 288 | }); |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | // reduce inventories if neccessary |
| 371 | 371 | if ($status->is_reducing) { |
| 372 | 372 | $id = $this->id; |
| 373 | - Queue::push(function () use ($id) { |
|
| 373 | + Queue::push(function() use ($id) { |
|
| 374 | 374 | $cart = Cart::findOrFail($id); |
| 375 | 375 | $cart->reduceAvailableInventory(); |
| 376 | 376 | }); |
@@ -63,7 +63,6 @@ |
||
| 63 | 63 | /** |
| 64 | 64 | * Populate attriutes based on config so a form can be rendered. |
| 65 | 65 | * |
| 66 | - * @param string $class |
|
| 67 | 66 | * @return void |
| 68 | 67 | */ |
| 69 | 68 | public function populate() |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('bedard_shop_driver_configs', function (Blueprint $table) { |
|
| 11 | + Schema::create('bedard_shop_driver_configs', function(Blueprint $table) { |
|
| 12 | 12 | $table->engine = 'InnoDB'; |
| 13 | 13 | $table->increments('id'); |
| 14 | 14 | $table->string('class')->default(''); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Schema::create('bedard_shop_inventories', function (Blueprint $table) { |
|
| 11 | + Schema::create('bedard_shop_inventories', function(Blueprint $table) { |
|
| 12 | 12 | $table->engine = 'InnoDB'; |
| 13 | 13 | $table->increments('id'); |
| 14 | 14 | $table->integer('product_id')->unsigned()->nullable()->index(); |