@@ -28,19 +28,19 @@ |
||
28 | 28 | throw new HttpException(Response::HTTP_FORBIDDEN, 'Invalid csrf token.'); |
29 | 29 | } |
30 | 30 | |
31 | - if (in_array($request->getMethod(), ['POST', 'PUT', 'PATCH'], true) && null !== $vendorsToUpdate) { |
|
31 | + if (in_array($request->getMethod(), [ 'POST', 'PUT', 'PATCH' ], true) && null !== $vendorsToUpdate) { |
|
32 | 32 | /** @var array $vendorToUpdate */ |
33 | 33 | foreach ($vendorsToUpdate as $vendorToUpdate) { |
34 | - if (!is_numeric($vendorToUpdate['position'])) { |
|
34 | + if (!is_numeric($vendorToUpdate[ 'position' ])) { |
|
35 | 35 | throw new HttpException( |
36 | 36 | Response::HTTP_NOT_ACCEPTABLE, |
37 | - sprintf('The vendor position "%s" is invalid.', $vendorToUpdate['position']) |
|
37 | + sprintf('The vendor position "%s" is invalid.', $vendorToUpdate[ 'position' ]) |
|
38 | 38 | ); |
39 | 39 | } |
40 | 40 | |
41 | 41 | /** @var VendorInterface $vendor */ |
42 | - $vendor = $this->repository->findOneBy(['id' => $vendorToUpdate['id']]); |
|
43 | - $vendor->setPosition((int) $vendorToUpdate['position']); |
|
42 | + $vendor = $this->repository->findOneBy([ 'id' => $vendorToUpdate[ 'id' ] ]); |
|
43 | + $vendor->setPosition((int) $vendorToUpdate[ 'position' ]); |
|
44 | 44 | $this->manager->flush(); |
45 | 45 | } |
46 | 46 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | ChannelInterface $channel, |
25 | 25 | VendorInterface $vendor, |
26 | 26 | string $locale, |
27 | - array $sorting = [] |
|
27 | + array $sorting = [ ] |
|
28 | 28 | ): QueryBuilder { |
29 | 29 | $queryBuilder = $this->createQueryBuilder('o') |
30 | 30 | ->distinct() |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ->setParameter('vendor', $vendor) |
43 | 43 | ; |
44 | 44 | |
45 | - if (isset($sorting['price'])) { |
|
45 | + if (isset($sorting[ 'price' ])) { |
|
46 | 46 | $subQuery = $this->createQueryBuilder('m') |
47 | 47 | ->select('min(v.position)') |
48 | 48 | ->innerJoin('m.variants', 'v') |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function createShopListQueryBuilder( |
20 | 20 | ChannelInterface $channel, |
21 | - array $sorting = [] |
|
21 | + array $sorting = [ ] |
|
22 | 22 | ): QueryBuilder; |
23 | 23 | |
24 | 24 | /** |
@@ -22,6 +22,6 @@ |
||
22 | 22 | ChannelInterface $channel, |
23 | 23 | VendorInterface $vendor, |
24 | 24 | string $locale, |
25 | - array $sorting = [] |
|
25 | + array $sorting = [ ] |
|
26 | 26 | ): QueryBuilder; |
27 | 27 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | public function createShopListQueryBuilder( |
18 | 18 | ChannelInterface $channel, |
19 | - array $sorting = [] |
|
19 | + array $sorting = [ ] |
|
20 | 20 | ): QueryBuilder { |
21 | 21 | return $this->findByEnabledQueryBuilder($channel); |
22 | 22 | } |