@@ -19,7 +19,7 @@ |
||
19 | 19 | if (request()->hasCookie('cart_identifier')) { |
20 | 20 | $cookie = request()->cookie('cart_identifier'); |
21 | 21 | |
22 | - if (is_string($cookie) && ! empty($cookie)) { |
|
22 | + if (is_string($cookie) && !empty($cookie)) { |
|
23 | 23 | return $cookie; |
24 | 24 | } |
25 | 25 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $this->loadViewsFrom(__DIR__.'/../resources/views', 'ecommerce'); |
38 | 38 | |
39 | 39 | if ($this->mustLoadRoute()) { |
40 | - Route::group($this->routeConfiguration(), function () { |
|
40 | + Route::group($this->routeConfiguration(), function() { |
|
41 | 41 | $this->loadRoutesFrom(__DIR__.'/routes.php'); |
42 | 42 | }); |
43 | 43 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | protected function mustLoadRoute(): bool |
47 | 47 | { |
48 | - return ! config('ecommerce.disable_default_route', false); |
|
48 | + return !config('ecommerce.disable_default_route', false); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | protected function routeConfiguration(): array |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function register() |
65 | 65 | { |
66 | - $this->app->singleton('basket', function () { |
|
66 | + $this->app->singleton('basket', function() { |
|
67 | 67 | return new Basket(new LaravelSession(), new LaravelCookie()); |
68 | 68 | }); |
69 | 69 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $router->get('basket/{id}/remove', [EcommerceController::class, 'remove'])->name('ecommerce.basket.item.remove'); |
29 | 29 | } |
30 | 30 | |
31 | - public function index(): View|Factory |
|
31 | + public function index(): View | Factory |
|
32 | 32 | { |
33 | 33 | return view('ecommerce::basket'); |
34 | 34 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $carts = Session::get('cart'); |
15 | 15 | |
16 | - if (! empty($carts)) { |
|
16 | + if (!empty($carts)) { |
|
17 | 17 | static::$cart = (array) $carts; |
18 | 18 | } |
19 | 19 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $cart = &static::$cart[$this->id]; |
43 | 43 | |
44 | - if (! $asArray) { |
|
44 | + if (!$asArray) { |
|
45 | 45 | return $cart; |
46 | 46 | } |
47 | 47 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @internal param mixed $id The item id |
85 | 85 | */ |
86 | - public function item(string $identifier): ItemInterface|bool |
|
86 | + public function item(string $identifier): ItemInterface | bool |
|
87 | 87 | { |
88 | 88 | foreach (static::$cart[$this->id] as $item) { |
89 | 89 | if ($item->identifier == $identifier) { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @return bool|ItemInterface |
103 | 103 | */ |
104 | - public function find(string $id): ItemInterface|bool |
|
104 | + public function find(string $id): ItemInterface | bool |
|
105 | 105 | { |
106 | 106 | foreach (static::$cart[$this->id] as $item) { |
107 | 107 | if ($item->id == $id) { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | $this->id = $identifier; |
147 | 147 | |
148 | - if (! array_key_exists($this->id, static::$cart)) { |
|
148 | + if (!array_key_exists($this->id, static::$cart)) { |
|
149 | 149 | static::$cart[$this->id] = []; |
150 | 150 | } |
151 | 151 |