@@ -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; |
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 | |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | public function register() |
17 | 17 | { |
18 | - $this->app->bind('cart', function () { |
|
18 | + $this->app->bind('cart', function() { |
|
19 | 19 | $kernel = new Kernel(); |
20 | 20 | $kernel->bootstrapping(); |
21 | 21 | $kernel->loadServiceProvider(); |
@@ -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,12 +36,12 @@ 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 | /** |
42 | 42 | * Get items to user id |
43 | 43 | * @param int $userId |
44 | 44 | * @return array |
45 | 45 | */ |
46 | - public function get(int $userId) : array ; |
|
46 | + public function get(int $userId) : array; |
|
47 | 47 | } |
48 | 48 | \ 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\Drivers; |
5 | 5 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $collection = $this->getItems($item['user_id']); |
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 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $row = $this->getItems($items['user_id']); |
154 | 154 | |
155 | 155 | if ($row->isNotEmpty()) { |
156 | - $transformItems = array_map(function ($value) use ($items, $newPrice) { |
|
156 | + $transformItems = array_map(function($value) use ($items, $newPrice) { |
|
157 | 157 | if ($value['id'] == $items['id']) { |
158 | 158 | $value['discount'] = $newPrice; |
159 | 159 | return $value; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | } |
237 | 237 | $items = fromJson($collection->first()->data, true); |
238 | 238 | |
239 | - $targetItem = array_filter($items, function ($value) use ($itemId) { |
|
239 | + $targetItem = array_filter($items, function($value) use ($itemId) { |
|
240 | 240 | return $value['id'] == $itemId; |
241 | 241 | }); |
242 | 242 |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | return true; |
90 | 90 | } |
91 | - return false; |
|
91 | + return false; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | if ($row->isNotEmpty()) { |
155 | 155 | $transformItems = array_map(function ($value) use ($items, $newPrice) { |
156 | 156 | if ($value['id'] == $items['id']) { |
157 | - $value['discount'] = $newPrice; |
|
158 | - return $value; |
|
157 | + $value['discount'] = $newPrice; |
|
158 | + return $value; |
|
159 | 159 | } |
160 | 160 | return $value; |
161 | 161 | }, fromJson($row->first()->data, true)); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $this->updateRow($items['user_id'], inJson($transformItems)); |
164 | 164 | return true; |
165 | 165 | } |
166 | - return false; |
|
166 | + return false; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |