@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function up() |
| 17 | 17 | { |
| 18 | - Capsule::schema()->create('cart_items', function (Blueprint $table) { |
|
| 18 | + Capsule::schema()->create('cart_items', function(Blueprint $table) { |
|
| 19 | 19 | $table->increments('id')->index()->unique(); |
| 20 | 20 | $table->integer('user_id')->unique(); |
| 21 | 21 | $table->json('data'); |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\CountOperation; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\ServiceProviders; |
| 5 | 5 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $capsule->bootEloquent(); |
| 34 | 34 | $container->bind(Manager::class, $capsule); |
| 35 | 35 | |
| 36 | - $container->bind(DatabaseDriver::class, function () use ($capsule) { |
|
| 36 | + $container->bind(DatabaseDriver::class, function() use ($capsule) { |
|
| 37 | 37 | return new DatabaseDriver($capsule); |
| 38 | 38 | }); |
| 39 | 39 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | use Illuminate\Container\Container; |
| 3 | 3 | |
| 4 | -if (! function_exists('config')) { |
|
| 4 | +if (!function_exists('config')) { |
|
| 5 | 5 | /** |
| 6 | 6 | * Get / set the specified configuration value. |
| 7 | 7 | * |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | -if (! function_exists('app')) { |
|
| 26 | +if (!function_exists('app')) { |
|
| 27 | 27 | /** |
| 28 | 28 | * Get the available container instance. |
| 29 | 29 | * |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | -if (! function_exists('inJson')) { |
|
| 45 | +if (!function_exists('inJson')) { |
|
| 46 | 46 | /** |
| 47 | 47 | * Sugar json_encode |
| 48 | 48 | * |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -if (! function_exists('fromJson')) { |
|
| 58 | +if (!function_exists('fromJson')) { |
|
| 59 | 59 | /** |
| 60 | 60 | * Sugar json_encode |
| 61 | 61 | * |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\Traits; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\Contracts; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\Contracts; |
| 5 | 5 | |
@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | * @param array $item |
| 14 | 14 | * @return mixed |
| 15 | 15 | */ |
| 16 | - public function add(array $item) : bool ; |
|
| 16 | + public function add(array $item) : bool; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * Remove item from cart |
| 20 | 20 | * @param array $itemId |
| 21 | 21 | * @return mixed |
| 22 | 22 | */ |
| 23 | - public function remove(array $itemId):bool ; |
|
| 23 | + public function remove(array $itemId):bool; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Clear cart for concrete relation entity |
@@ -36,5 +36,5 @@ discard block |
||
| 36 | 36 | * @param CounterItemContract $itemContract |
| 37 | 37 | * @return mixed |
| 38 | 38 | */ |
| 39 | - public function change(array $item, CounterItemContract $itemContract) : bool ; |
|
| 39 | + public function change(array $item, CounterItemContract $itemContract) : bool; |
|
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\Contracts; |
| 5 | 5 | |
@@ -15,5 +15,5 @@ discard block |
||
| 15 | 15 | * @param array $items |
| 16 | 16 | * @return bool |
| 17 | 17 | */ |
| 18 | - public function discount(DiscountContract $contract, array $items) : bool ; |
|
| 18 | + public function discount(DiscountContract $contract, array $items) : bool; |
|
| 19 | 19 | } |
| 20 | 20 | \ No newline at end of file |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | return true; |
| 91 | 91 | } |
| 92 | - return false; |
|
| 92 | + return false; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | if ($row->isNotEmpty()) { |
| 145 | 145 | $transformItems = array_map(function ($value) use ($items, $newPrice) { |
| 146 | 146 | if ($value['id'] == $items['id']) { |
| 147 | - $value['discount'] = $newPrice; |
|
| 148 | - return $value; |
|
| 147 | + $value['discount'] = $newPrice; |
|
| 148 | + return $value; |
|
| 149 | 149 | } |
| 150 | 150 | return $value; |
| 151 | 151 | }, fromJson($row->first()->data, true)); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $this->updateRow($items['user_id'], inJson($transformItems)); |
| 154 | 154 | return true; |
| 155 | 155 | } |
| 156 | - return false; |
|
| 156 | + return false; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\Drivers; |
| 5 | 5 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $collection = $this->manager->table($this->table)->where('user_id', '=', $item['user_id'])->get(); |
| 78 | 78 | |
| 79 | 79 | if ($collection->isNotEmpty()) { |
| 80 | - $itemFilter = array_filter(fromJson($collection->first()->data, true), function ($value) use ($item) { |
|
| 80 | + $itemFilter = array_filter(fromJson($collection->first()->data, true), function($value) use ($item) { |
|
| 81 | 81 | return $value['id'] != $item['id']; |
| 82 | 82 | }); |
| 83 | 83 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $row = $this->manager->table($this->table)->where('user_id', $items['user_id'])->get(); |
| 143 | 143 | |
| 144 | 144 | if ($row->isNotEmpty()) { |
| 145 | - $transformItems = array_map(function ($value) use ($items, $newPrice) { |
|
| 145 | + $transformItems = array_map(function($value) use ($items, $newPrice) { |
|
| 146 | 146 | if ($value['id'] == $items['id']) { |
| 147 | 147 | $value['discount'] = $newPrice; |
| 148 | 148 | return $value; |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | $items = fromJson($collection->first()->data, true); |
| 227 | 227 | |
| 228 | - $targetItem = array_filter($items, function ($value) use ($itemId) { |
|
| 228 | + $targetItem = array_filter($items, function($value) use ($itemId) { |
|
| 229 | 229 | return $value['id'] == $itemId; |
| 230 | 230 | }); |
| 231 | 231 | |