@@ -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 | |
@@ -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 |
@@ -178,7 +178,7 @@ |
||
| 178 | 178 | */ |
| 179 | 179 | private function existItem(int $itemId, int $userId) : bool |
| 180 | 180 | { |
| 181 | - return !is_null($this->redis->hget($this->normalizeKey($userId), $itemId)); |
|
| 181 | + return !is_null($this->redis->hget($this->normalizeKey($userId), $itemId)); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
@@ -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 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | public function get(int $userId) : array |
| 149 | 149 | { |
| 150 | 150 | $items = $this->redis->hgetall($this->normalizeKey((int)$userId)); |
| 151 | - $items = array_map(function (string $value) { |
|
| 151 | + $items = array_map(function(string $value) { |
|
| 152 | 152 | return unserialize($value); |
| 153 | 153 | }, $items); |
| 154 | 154 | |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\DiscountStrategy; |
| 5 | 5 | |