Completed
Pull Request — master (#124)
by Luke
02:19
created
src/LaraCart.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/CartItem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/LaraCartServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         );
Please login to merge, or discard this patch.