@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | /** |
| 516 | 516 | * Gets the total tax for the cart |
| 517 | 517 | * |
| 518 | - * @param bool|true $format |
|
| 518 | + * @param boolean $format |
|
| 519 | 519 | * |
| 520 | 520 | * @return string |
| 521 | 521 | */ |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | * |
| 703 | 703 | * @param $itemModel |
| 704 | 704 | * |
| 705 | - * @return bool |
|
| 705 | + * @return boolean|null |
|
| 706 | 706 | */ |
| 707 | 707 | private function isItemModel($itemModel) |
| 708 | 708 | { |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->itemModel = config('laracart.item_model', null); |
| 47 | 47 | $this->itemModelRelations = config('laracart.item_model_relations', []); |
| 48 | 48 | |
| 49 | - $this->setInstance($this->session->get($this->prefix . '.instance', 'default')); |
|
| 49 | + $this->setInstance($this->session->get($this->prefix.'.instance', 'default')); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function getInstances() |
| 58 | 58 | { |
| 59 | - return $this->session->get($this->prefix . '.instances', []); |
|
| 59 | + return $this->session->get($this->prefix.'.instances', []); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $this->get($instance); |
| 72 | 72 | |
| 73 | - $this->session->set($this->prefix . '.instance', $instance); |
|
| 73 | + $this->session->set($this->prefix.'.instance', $instance); |
|
| 74 | 74 | |
| 75 | 75 | if (!in_array($instance, $this->getInstances())) { |
| 76 | - $this->session->push($this->prefix . '.instances', $instance); |
|
| 76 | + $this->session->push($this->prefix.'.instances', $instance); |
|
| 77 | 77 | } |
| 78 | 78 | $this->events->fire('laracart.new'); |
| 79 | 79 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (empty($this->cart = $this->session->get($this->prefix . '.' . $instance))) { |
|
| 99 | + if (empty($this->cart = $this->session->get($this->prefix.'.'.$instance))) { |
|
| 100 | 100 | $this->cart = new Cart($instance); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function update() |
| 146 | 146 | { |
| 147 | - $this->session->set($this->prefix . '.' . $this->cart->instance, $this->cart); |
|
| 147 | + $this->session->set($this->prefix.'.'.$this->cart->instance, $this->cart); |
|
| 148 | 148 | |
| 149 | 149 | if (config('laracart.cross_devices', false) && $this->authManager->check()) { |
| 150 | 150 | $this->authManager->user()->cart_session_id = $this->session->getId(); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (empty($itemModel)) { |
| 223 | - throw new ModelNotFound('Could not find the item ' . $itemID); |
|
| 223 | + throw new ModelNotFound('Could not find the item '.$itemID); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | $bindings = config('laracart.item_model_bindings'); |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | { |
| 425 | 425 | $instance = $this->cart->instance; |
| 426 | 426 | |
| 427 | - $this->session->forget($this->prefix . '.' . $instance); |
|
| 427 | + $this->session->forget($this->prefix.'.'.$instance); |
|
| 428 | 428 | |
| 429 | 429 | $this->setInstance('default'); |
| 430 | 430 | |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | $itemOptions[$option] = $this->getFromModel($itemModel, $option); |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | - return array_filter($itemOptions, function ($value) { |
|
| 758 | + return array_filter($itemOptions, function($value) { |
|
| 759 | 759 | if ($value !== false && empty($value)) { |
| 760 | 760 | return false; |
| 761 | 761 | } |
@@ -61,6 +61,6 @@ |
||
| 61 | 61 | */ |
| 62 | 62 | public function displayValue() |
| 63 | 63 | { |
| 64 | - return ($this->value * 100) . '%'; |
|
| 64 | + return ($this->value * 100).'%'; |
|
| 65 | 65 | } |
| 66 | 66 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | return true; |
| 65 | 65 | } else { |
| 66 | 66 | if ($throwErrors) { |
| 67 | - throw new CouponException('You must have at least a total of ' . $laraCart->formatMoney($minAmount)); |
|
| 67 | + throw new CouponException('You must have at least a total of '.$laraCart->formatMoney($minAmount)); |
|
| 68 | 68 | } else { |
| 69 | 69 | return false; |
| 70 | 70 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | return $discount; |
| 88 | 88 | } else { |
| 89 | 89 | if ($throwErrors) { |
| 90 | - throw new CouponException('This has a max discount of ' . \App::make(\LukePOLO\Laracart\LaraCart::SERVICE)->formatMoney($maxDiscount)); |
|
| 90 | + throw new CouponException('This has a max discount of '.\App::make(\LukePOLO\Laracart\LaraCart::SERVICE)->formatMoney($maxDiscount)); |
|
| 91 | 91 | } else { |
| 92 | 92 | return $maxDiscount; |
| 93 | 93 | } |
@@ -292,7 +292,7 @@ |
||
| 292 | 292 | $itemModel->with($this->itemModelRelations)->find($this->id); |
| 293 | 293 | |
| 294 | 294 | if (empty($itemModel)) { |
| 295 | - throw new ModelNotFound('Could not find the item model for ' . $this->id); |
|
| 295 | + throw new ModelNotFound('Could not find the item model for '.$this->id); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | return $itemModel; |
@@ -19,17 +19,17 @@ discard block |
||
| 19 | 19 | public function boot() |
| 20 | 20 | { |
| 21 | 21 | $this->publishes([ |
| 22 | - __DIR__ . '/config/laracart.php' => config_path('laracart.php'), |
|
| 22 | + __DIR__.'/config/laracart.php' => config_path('laracart.php'), |
|
| 23 | 23 | ]); |
| 24 | 24 | |
| 25 | 25 | $this->mergeConfigFrom( |
| 26 | - __DIR__ . '/config/laracart.php', |
|
| 26 | + __DIR__.'/config/laracart.php', |
|
| 27 | 27 | 'laracart' |
| 28 | 28 | ); |
| 29 | 29 | |
| 30 | 30 | if (!$this->migrationHasAlreadyBeenPublished()) { |
| 31 | 31 | $this->publishes([ |
| 32 | - __DIR__ . '/database/migrations/add_cart_session_id_to_users_table.php.stub' => database_path('migrations/' . date('Y_m_d_His') . '_add_cart_session_id_to_users_table.php'), |
|
| 32 | + __DIR__.'/database/migrations/add_cart_session_id_to_users_table.php.stub' => database_path('migrations/'.date('Y_m_d_His').'_add_cart_session_id_to_users_table.php'), |
|
| 33 | 33 | ], 'migrations'); |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -41,21 +41,21 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function register() |
| 43 | 43 | { |
| 44 | - $this->app->singleton(LaraCart::SERVICE, function ($app) { |
|
| 44 | + $this->app->singleton(LaraCart::SERVICE, function($app) { |
|
| 45 | 45 | return new LaraCart($app['session'], $app['events'], $app['auth']); |
| 46 | 46 | } |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | $this->app->bind( |
| 50 | 50 | LaraCart::HASH, |
| 51 | - function ($app, $data) { |
|
| 51 | + function($app, $data) { |
|
| 52 | 52 | return md5(json_encode($data)); |
| 53 | 53 | } |
| 54 | 54 | ); |
| 55 | 55 | |
| 56 | 56 | $this->app->bind( |
| 57 | 57 | LaraCart::RANHASH, |
| 58 | - function () { |
|
| 58 | + function() { |
|
| 59 | 59 | return str_random(40); |
| 60 | 60 | } |
| 61 | 61 | ); |