Passed
Push — main ( 1d2b40...16796b )
by Carsten
14:37 queued 10:43
created
src/Storage/LaravelSession.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/EcommerceServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->loadViewsFrom(__DIR__.'/../resources/views', 'ecommerce');
36 36
 
37 37
         if ($this->mustLoadRoute()) {
38
-            Route::group($this->routeConfiguration(), function () {
38
+            Route::group($this->routeConfiguration(), function() {
39 39
                 $this->loadRoutesFrom(__DIR__.'/routes.php');
40 40
             });
41 41
         }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     protected function mustLoadRoute(): bool
45 45
     {
46
-        return ! config('ecommerce.disable_default_route', false);
46
+        return !config('ecommerce.disable_default_route', false);
47 47
     }
48 48
 
49 49
     protected function routeConfiguration(): array
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function register(): void
63 63
     {
64
-        $this->app->singleton('cart', function () {
64
+        $this->app->singleton('cart', function() {
65 65
             return new Cart(new LaravelSession(), new LaravelCookie(), resolve('events'));
66 66
         });
67 67
     }
Please login to merge, or discard this patch.
src/Http/Controllers/EcommerceController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         $router->get('cart/{id}/remove', [self::class, 'remove'])->name('ecommerce.cart.item.remove');
30 30
     }
31 31
 
32
-    public function index(): Factory|View|Application
32
+    public function index(): Factory | View | Application
33 33
     {
34 34
         return view('ecommerce::cart');
35 35
     }
Please login to merge, or discard this patch.
src/Cart.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      *
80 80
      * @return ItemInterface|bool
81 81
      */
82
-    public function inc(string $itemIdentifier): ItemInterface|bool
82
+    public function inc(string $itemIdentifier): ItemInterface | bool
83 83
     {
84 84
         if ($item = Cart::item($itemIdentifier)) {
85 85
             /** @var ItemInterface $item */
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      *
100 100
      * @return ItemInterface|bool
101 101
      */
102
-    public function dec(string $itemIdentifier): ItemInterface|bool
102
+    public function dec(string $itemIdentifier): ItemInterface | bool
103 103
     {
104 104
         if ($item = Cart::item($itemIdentifier)) {
105 105
             /** @var ItemInterface $item */
Please login to merge, or discard this patch.
src/Identifier/LaravelCookie.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         if (request()?->hasCookie('cart_identifier')) {
22 22
             $cookie = request()?->cookie('cart_identifier');
23 23
 
24
-            if (is_string($cookie) && ! empty($cookie)) {
24
+            if (is_string($cookie) && !empty($cookie)) {
25 25
                 return $cookie;
26 26
             }
27 27
         }
Please login to merge, or discard this patch.