@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | ): array { |
85 | 85 | $to = $to ?? $from; // If to is null, take the same day as from to make report on one day |
86 | 86 | try { |
87 | - $from = new \DateTime($from->format("Y-m-d")." 00:00:00"); |
|
88 | - $to = new \DateTime($to->format("Y-m-d")." 23:59:59"); |
|
87 | + $from = new \DateTime($from->format("Y-m-d") . " 00:00:00"); |
|
88 | + $to = new \DateTime($to->format("Y-m-d") . " 23:59:59"); |
|
89 | 89 | } catch (\Exception $e) { |
90 | 90 | throw new InvalidDateException('Invalid date given to report.'); |
91 | 91 | } |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | ): array { |
140 | 140 | $to = $to ?? $from; // If to is null, take the same day as from to make report on one day |
141 | 141 | try { |
142 | - $from = new \DateTime($from->format("Y-m-d")." 00:00:00"); |
|
143 | - $to = new \DateTime($to->format("Y-m-d")." 23:59:59"); |
|
142 | + $from = new \DateTime($from->format("Y-m-d") . " 00:00:00"); |
|
143 | + $to = new \DateTime($to->format("Y-m-d") . " 23:59:59"); |
|
144 | 144 | } catch (\Exception $e) { |
145 | 145 | throw new InvalidDateException('Invalid date given to report.'); |
146 | 146 | } |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | ): array { |
176 | 176 | $to = $to ?? $from; // If to is null, take the same day as from to make report on one day |
177 | 177 | try { |
178 | - $from = new \DateTime($from->format("Y-m-d")." 00:00:00"); |
|
179 | - $to = new \DateTime($to->format("Y-m-d")." 23:59:59"); |
|
178 | + $from = new \DateTime($from->format("Y-m-d") . " 00:00:00"); |
|
179 | + $to = new \DateTime($to->format("Y-m-d") . " 23:59:59"); |
|
180 | 180 | } catch (\Exception $e) { |
181 | 181 | throw new InvalidDateException('Invalid date given to report.'); |
182 | 182 | } |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | ): array { |
220 | 220 | $to = $to ?? $from; // If to is null, take the same day as from to make report on one day |
221 | 221 | try { |
222 | - $from = new \DateTime($from->format("Y-m-d")." 00:00:00"); |
|
223 | - $to = new \DateTime($to->format("Y-m-d")." 23:59:59"); |
|
222 | + $from = new \DateTime($from->format("Y-m-d") . " 00:00:00"); |
|
223 | + $to = new \DateTime($to->format("Y-m-d") . " 23:59:59"); |
|
224 | 224 | } catch (\Exception $e) { |
225 | 225 | throw new InvalidDateException('Invalid date given to report.'); |
226 | 226 | } |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | ): array { |
264 | 264 | $to = $to ?? $from; // If to is null, take the same day as from to make report on one day |
265 | 265 | try { |
266 | - $from = new \DateTime($from->format("Y-m-d")." 00:00:00"); |
|
267 | - $to = new \DateTime($to->format("Y-m-d")." 23:59:59"); |
|
266 | + $from = new \DateTime($from->format("Y-m-d") . " 00:00:00"); |
|
267 | + $to = new \DateTime($to->format("Y-m-d") . " 23:59:59"); |
|
268 | 268 | } catch (\Exception $e) { |
269 | 269 | throw new InvalidDateException('Invalid date given to report.'); |
270 | 270 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | */ |
361 | 361 | protected function getSelectColumns(bool $isItemUnit = false, bool $isItem = false, bool $isOrder = false): string |
362 | 362 | { |
363 | - return implode(',',[ |
|
363 | + return implode(',', [ |
|
364 | 364 | // Order ID |
365 | 365 | 'o.id as order_id', |
366 | 366 | |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $variantOptions = $this->getVariantsOptions($localeCode); |
445 | 445 | $salesResults = []; |
446 | 446 | |
447 | - foreach($this->results as $result) { |
|
447 | + foreach ($this->results as $result) { |
|
448 | 448 | $variantId = $result['variant_id']; |
449 | 449 | $options = $variantOptions[$variantId]; |
450 | 450 | |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | $this->result[$groupField] = $elementId; // Grouped field ID |
569 | 569 | if ($labelField && isset($elementResult[$labelField]) && !empty($elementResult[$labelField])) { |
570 | 570 | $this->result[$labelField] = $elementResult[$labelField]; // Grouped field label if given |
571 | - } elseif($labelField && (!isset($elementResult[$labelField]) || empty($elementResult[$labelField]))) { |
|
571 | + } elseif ($labelField && (!isset($elementResult[$labelField]) || empty($elementResult[$labelField]))) { |
|
572 | 572 | $this->result[$labelField] = ''; |
573 | 573 | } |
574 | 574 | if (!empty($extraFields)) { |