@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $productIds = []; |
42 | 42 | if (!$this->isAllSelected() && array_key_exists('values', $this->args)) { |
43 | 43 | $productIds = array_map( |
44 | - function ($id) { |
|
45 | - return (int) $id; |
|
44 | + function($id) { |
|
45 | + return (int)$id; |
|
46 | 46 | }, |
47 | 47 | explode(',', $this->args['values']) |
48 | 48 | ); |
@@ -68,6 +68,6 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function isAllSelected() |
70 | 70 | { |
71 | - return array_key_exists('inset', $this->args) && (int) $this->args['inset'] === 0; |
|
71 | + return array_key_exists('inset', $this->args) && (int)$this->args['inset'] === 0; |
|
72 | 72 | } |
73 | 73 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | private function doSimpleProductSupportsUnitPrecision(Product $product, ProductUnitPrecision $unit) |
166 | 166 | { |
167 | 167 | $productUnits = $product->getUnitPrecisions()->map( |
168 | - function (ProductUnitPrecision $unitPrecision) { |
|
168 | + function(ProductUnitPrecision $unitPrecision) { |
|
169 | 169 | return $unitPrecision->getUnit(); |
170 | 170 | } |
171 | 171 | ); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | if ($column->product) { |
199 | 199 | $lineItem = new LineItem(); |
200 | 200 | $lineItem->setProduct($column->product); |
201 | - $lineItem->setQuantity((float) $column->quantity); |
|
201 | + $lineItem->setQuantity((float)$column->quantity); |
|
202 | 202 | $lineItem->setUnit($collection->unit); |
203 | 203 | |
204 | 204 | if ($product->isConfigurable()) { |
@@ -132,6 +132,6 @@ |
||
132 | 132 | ->getQuery() |
133 | 133 | ->getSingleScalarResult(); |
134 | 134 | |
135 | - return (integer) $results; |
|
135 | + return (integer)$results; |
|
136 | 136 | } |
137 | 137 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | ORDER BY li.shoppingList DESC, li.id DESC |
147 | 147 | DQL; |
148 | 148 | $shoppingListIds = array_map( |
149 | - function (ShoppingList $shoppingList) { |
|
149 | + function(ShoppingList $shoppingList) { |
|
150 | 150 | return $shoppingList->getId(); |
151 | 151 | }, |
152 | 152 | $shoppingLists |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $result = []; |
163 | 163 | |
164 | 164 | $productsIds = array_map( |
165 | - function (LineItem $lineItem) { |
|
165 | + function(LineItem $lineItem) { |
|
166 | 166 | return $lineItem->getProduct()->getId(); |
167 | 167 | }, |
168 | 168 | $lineItems |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
201 | - $result = array_map(function (array $lineItemsByShoppingList) use ($productCount) { |
|
201 | + $result = array_map(function(array $lineItemsByShoppingList) use ($productCount) { |
|
202 | 202 | return array_slice($lineItemsByShoppingList, 0, $productCount); |
203 | 203 | }, $result); |
204 | 204 |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | protected function setByProducts($products) |
66 | 66 | { |
67 | - $products = array_filter($products, function (Product $product) { |
|
67 | + $products = array_filter($products, function(Product $product) { |
|
68 | 68 | return !array_key_exists($product->getId(), $this->data); |
69 | 69 | }); |
70 | 70 | if (!$products) { |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | |
239 | 239 | $this->shoppingListManager->expects($this->once())->method('bulkAddLineItems')->with( |
240 | 240 | $this->callback( |
241 | - function (array $lineItems) use ($expectedLineItems, $customerUser, $organization) { |
|
241 | + function(array $lineItems) use ($expectedLineItems, $customerUser, $organization) { |
|
242 | 242 | /** @var LineItem $lineItem */ |
243 | 243 | foreach ($lineItems as $key => $lineItem) { |
244 | 244 | /** @var LineItem $expectedLineItem */ |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | |
366 | 366 | $productUnitRepository->expects($this->any()) |
367 | 367 | ->method('findOneBy') |
368 | - ->willReturnCallback(function ($unit) { |
|
368 | + ->willReturnCallback(function($unit) { |
|
369 | 369 | return $this->getEntity(ProductUnit::class, ['code' => $unit]); |
370 | 370 | }); |
371 | 371 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | |
384 | 384 | $em->expects($this->any())->method('getReference')->will( |
385 | 385 | $this->returnCallback( |
386 | - function ($className, $id) { |
|
386 | + function($className, $id) { |
|
387 | 387 | return $this->getEntity($className, ['id' => $id]); |
388 | 388 | } |
389 | 389 | ) |
@@ -180,7 +180,7 @@ |
||
180 | 180 | ->with($shoppingList); |
181 | 181 | $em->expects($this->once()) |
182 | 182 | ->method('flush') |
183 | - ->willReturnCallback(function () use ($shoppingList) { |
|
183 | + ->willReturnCallback(function() use ($shoppingList) { |
|
184 | 184 | $shoppingList->setId(5); |
185 | 185 | }); |
186 | 186 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | $this->translator->expects($this->any()) |
46 | 46 | ->method('trans') |
47 | - ->willReturnCallback(function ($label) { |
|
47 | + ->willReturnCallback(function($label) { |
|
48 | 48 | return $label; |
49 | 49 | }); |
50 | 50 |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $manager->expects($this->exactly(count($relatedLineItems))) |
279 | 279 | ->method('remove') |
280 | 280 | ->willReturnCallback( |
281 | - function (LineItem $item) { |
|
281 | + function(LineItem $item) { |
|
282 | 282 | $this->lineItems[] = $item; |
283 | 283 | } |
284 | 284 | ); |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | ->method('roundQuantity') |
526 | 526 | ->will( |
527 | 527 | $this->returnCallback( |
528 | - function ($value) { |
|
528 | + function($value) { |
|
529 | 529 | return round($value, 0, PHP_ROUND_HALF_UP); |
530 | 530 | } |
531 | 531 | ) |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | $lineItemRepository |
555 | 555 | ->expects($this->any()) |
556 | 556 | ->method('findDuplicate') |
557 | - ->willReturnCallback(function (LineItem $lineItem) { |
|
557 | + ->willReturnCallback(function(LineItem $lineItem) { |
|
558 | 558 | /** @var ArrayCollection $shoppingListLineItems */ |
559 | 559 | $shoppingListLineItems = $lineItem->getShoppingList()->getLineItems(); |
560 | 560 | if ($lineItem->getShoppingList()->getId() === 1 |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | |
582 | 582 | $entityManager->expects($this->any()) |
583 | 583 | ->method('persist') |
584 | - ->willReturnCallback(function ($obj) { |
|
584 | + ->willReturnCallback(function($obj) { |
|
585 | 585 | if ($obj instanceof ShoppingList) { |
586 | 586 | $this->shoppingLists[] = $obj; |
587 | 587 | } |