@@ -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 | |
@@ -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 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\Drivers; |
| 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\DiscountStrategy; |
| 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\DiscountStrategy; |
| 5 | 5 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $price = $basePrice - $this->sign; |
| 29 | 29 | if ($price < 0) { |
| 30 | - $price = 0 ; |
|
| 30 | + $price = 0; |
|
| 31 | 31 | } |
| 32 | 32 | return $price; |
| 33 | 33 | } |
@@ -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\Commands; |
| 5 | 5 | |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | protected function execute(InputInterface $input, OutputInterface $output) : void |
| 26 | 26 | { |
| 27 | 27 | foreach (Finder::create()->files()->name('*.php')-> |
| 28 | - in(__DIR__. '/../../migrations') as $file) { |
|
| 28 | + in(__DIR__ . '/../../migrations') as $file) { |
|
| 29 | 29 | $classes = get_declared_classes(); |
| 30 | 30 | include $file->getRealPath(); |
| 31 | 31 | $diff = array_diff(get_declared_classes(), $classes); |
| 32 | 32 | $class = reset($diff); |
| 33 | 33 | |
| 34 | 34 | (new $class())->up(); |
| 35 | - $output->writeln('<fg=green>Success added migration: ' . basename($file->getFilename(), '.php') .'</>'); |
|
| 35 | + $output->writeln('<fg=green>Success added migration: ' . basename($file->getFilename(), '.php') . '</>'); |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | \ 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 | namespace Cart\Commands; |
| 4 | 4 | |
| 5 | 5 | use Carbon\Carbon; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | protected function moveMigrate(ProgressBar $progress) |
| 54 | 54 | { |
| 55 | - $pathToMigrationsLaravel = $_SERVER["PWD"] . '/database/migrations/'; |
|
| 55 | + $pathToMigrationsLaravel = $_SERVER["PWD"] . '/database/migrations/'; |
|
| 56 | 56 | $pathToStubs = __DIR__ . '/migrations/stubs/'; |
| 57 | 57 | $this->createDir($pathToMigrationsLaravel); |
| 58 | 58 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | protected function moveConfig(ProgressBar $progress) : void |
| 67 | 67 | { |
| 68 | 68 | $pathToConfig = __DIR__ . '/../config.php'; |
| 69 | - $pathToConfigsLaravel = $_SERVER["PWD"] . '/config/'; |
|
| 69 | + $pathToConfigsLaravel = $_SERVER["PWD"] . '/config/'; |
|
| 70 | 70 | $this->createDir($pathToConfigsLaravel); |
| 71 | 71 | copy($pathToConfig, $pathToConfigsLaravel . 'geography.php'); |
| 72 | 72 | $progress->advance(); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | protected function execute(InputInterface $input, OutputInterface $output) |
| 21 | 21 | { |
| 22 | 22 | foreach (Finder::create()->files()->name('*.php') |
| 23 | - ->in(__DIR__. '/../../migrations') as $file) { |
|
| 23 | + ->in(__DIR__. '/../../migrations') as $file) { |
|
| 24 | 24 | $classes = get_declared_classes(); |
| 25 | 25 | include $file->getRealPath(); |
| 26 | 26 | $diff = array_diff(get_declared_classes(), $classes); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | namespace Cart\Commands; |
| 4 | 4 | |
| 5 | 5 | use Symfony\Component\Console\Command\Command; |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | protected function execute(InputInterface $input, OutputInterface $output) |
| 21 | 21 | { |
| 22 | 22 | foreach (Finder::create()->files()->name('*.php') |
| 23 | - ->in(__DIR__. '/../../migrations') as $file) { |
|
| 23 | + ->in(__DIR__ . '/../../migrations') as $file) { |
|
| 24 | 24 | $classes = get_declared_classes(); |
| 25 | 25 | include $file->getRealPath(); |
| 26 | 26 | $diff = array_diff(get_declared_classes(), $classes); |
| 27 | 27 | $class = reset($diff); |
| 28 | 28 | (new $class())->down(); |
| 29 | - $output->writeln('<fg=green>Success rollback migration: ' . basename($file->getFilename(), '.php') .'</>'); |
|
| 29 | + $output->writeln('<fg=green>Success rollback migration: ' . basename($file->getFilename(), '.php') . '</>'); |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | \ No newline at end of file |
@@ -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 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Cart\Contracts; |
| 5 | 5 | |