@@ -56,7 +56,7 @@ |
||
56 | 56 | foreach ($searchAddresses as $address) { |
57 | 57 | $provinceName = $this->getProvinceName($address); |
58 | 58 | $provinceLabel = ucfirst(strtolower($provinceName)).', '.$address->getCountryCode(); |
59 | - $isNew = count(array_filter($addresses, function ($address) use ($provinceLabel) { |
|
59 | + $isNew = count(array_filter($addresses, function($address) use ($provinceLabel) { |
|
60 | 60 | return $address['province'] === $provinceLabel; |
61 | 61 | })) === 0; |
62 | 62 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | /** @var AddressInterface $address */ |
49 | 49 | foreach ($searchAddresses as $address) { |
50 | 50 | $cityLabel = ucfirst(strtolower($address->getCity())).', '.$address->getCountryCode(); |
51 | - $isNew = count(array_filter($addresses, function ($address) use ($cityLabel) { |
|
51 | + $isNew = count(array_filter($addresses, function($address) use ($cityLabel) { |
|
52 | 52 | return $address['city'] === $cityLabel; |
53 | 53 | })) === 0; |
54 | 54 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | /** @var AddressInterface $address */ |
49 | 49 | foreach ($searchAddresses as $address) { |
50 | 50 | $postcodeLabel = $address->getPostcode().', '.$address->getCountryCode(); |
51 | - $isNew = count(array_filter($addresses, function ($address) use ($postcodeLabel) { |
|
51 | + $isNew = count(array_filter($addresses, function($address) use ($postcodeLabel) { |
|
52 | 52 | return $address['postcode'] === $postcodeLabel; |
53 | 53 | })) === 0; |
54 | 54 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | return $this->createQueryBuilder('o') |
21 | 21 | ->andWhere('o.city LIKE :city') |
22 | - ->setParameter('city', '%' . $cityName . '%') |
|
22 | + ->setParameter('city', '%'.$cityName.'%') |
|
23 | 23 | ->getQuery() |
24 | 24 | ->getResult() |
25 | 25 | ; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | ->leftJoin(Province::class, 'p', 'WITH', 'p.code = o.provinceCode') |
35 | 35 | ->where('o.provinceName LIKE :province') |
36 | 36 | ->orWhere('p.name LIKE :province') |
37 | - ->setParameter('province', '%' . $provinceName . '%') |
|
37 | + ->setParameter('province', '%'.$provinceName.'%') |
|
38 | 38 | ->getQuery() |
39 | 39 | ->getResult() |
40 | 40 | ; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | return $this->createQueryBuilder('o') |
49 | 49 | ->andWhere('o.postcode LIKE :postcode') |
50 | - ->setParameter('postcode', '%' . $postcode . '%') |
|
50 | + ->setParameter('postcode', '%'.$postcode.'%') |
|
51 | 51 | ->getQuery() |
52 | 52 | ->getResult() |
53 | 53 | ; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $endDate = $configuration['timePeriod']['end']; |
38 | 38 | |
39 | 39 | //There is added 23 hours 59 minutes 59 seconds to the end date to provide records for whole end date |
40 | - $configuration['timePeriod']['end'] = $endDate?$endDate->add(new \DateInterval('PT23H59M59S')):null; |
|
40 | + $configuration['timePeriod']['end'] = $endDate ? $endDate->add(new \DateInterval('PT23H59M59S')) : null; |
|
41 | 41 | |
42 | 42 | switch ($configuration['timePeriod']['period']) { |
43 | 43 | case self::PERIOD_DAY: |
@@ -165,16 +165,16 @@ discard block |
||
165 | 165 | foreach ($datas as $data) { |
166 | 166 | $date = new \DateTime($data[$labels[0]]); |
167 | 167 | $dateFormated = $date->format($configuration['timePeriod']['presentationFormat']); |
168 | - $currentDateMedia = isset($datesMedia[$dateFormated])?$datesMedia[$dateFormated]:array('quantity' => 0, 'media' => 0); |
|
169 | - $currentDateMedia['quantity'] = $currentDateMedia['quantity']+1; |
|
170 | - $currentDateMedia['media'] = $currentDateMedia['media']+$data[$labels[1]]; |
|
168 | + $currentDateMedia = isset($datesMedia[$dateFormated]) ? $datesMedia[$dateFormated] : array('quantity' => 0, 'media' => 0); |
|
169 | + $currentDateMedia['quantity'] = $currentDateMedia['quantity'] + 1; |
|
170 | + $currentDateMedia['media'] = $currentDateMedia['media'] + $data[$labels[1]]; |
|
171 | 171 | $datesMedia[$dateFormated] = $currentDateMedia; |
172 | 172 | } |
173 | 173 | $fetched = []; |
174 | 174 | foreach ($datesMedia as $date => $dateMedia) { |
175 | 175 | $fetched[] = [ |
176 | 176 | $labels[0] => $date, |
177 | - $labels[1] => round($dateMedia['media']/$dateMedia['quantity'], 1) |
|
177 | + $labels[1] => round($dateMedia['media'] / $dateMedia['quantity'], 1) |
|
178 | 178 | ]; |
179 | 179 | } |
180 | 180 | return $fetched; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | /** @var \DateTime $startDateTime */ |
120 | 120 | $startDateTime = $configuration['timePeriod']['start']; |
121 | 121 | /** @var \DateTime $endDateTime */ |
122 | - $endDateTime = $configuration['timePeriod']['end']?:new \DateTime(); |
|
122 | + $endDateTime = $configuration['timePeriod']['end'] ?: new \DateTime(); |
|
123 | 123 | |
124 | 124 | $this->qb |
125 | 125 | ->addSelect($groupByParts[0]) |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $type = 'user'.ucfirst($addressType).'City'; |
261 | 261 | |
262 | 262 | if (isset($configuration[$type]) && count($configuration[$type]) > 0) { |
263 | - $cities = $configuration[$type]->map(function (AddressInterface $address) { |
|
263 | + $cities = $configuration[$type]->map(function(AddressInterface $address) { |
|
264 | 264 | return $address->getCity(); |
265 | 265 | })->toArray(); |
266 | 266 | $rootAlias = $cAlias = $this->qb->getRootAliases()[0]; |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | public function addOrderNumbers(array $configuration = [], string $field = 'o.id'): void |
346 | 346 | { |
347 | 347 | if (isset($configuration['orderNumbers']) && count($configuration['orderNumbers']) > 0) { |
348 | - $orderIds = $configuration['orderNumbers']->map(function (OrderInterface $order) { |
|
348 | + $orderIds = $configuration['orderNumbers']->map(function(OrderInterface $order) { |
|
349 | 349 | return $order->getId(); |
350 | 350 | })->toArray(); |
351 | 351 |