@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | return static function(ECSConfig $ecsConfig): void { |
7 | 7 | $ecsConfig->paths([ |
8 | - __DIR__ . '/src', |
|
8 | + __DIR__.'/src', |
|
9 | 9 | __FILE__, |
10 | 10 | ]); |
11 | 11 | $ecsConfig->parallel(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @var string|array The previous order in the query |
39 | 39 | */ |
40 | - public string|array $preOrder = []; |
|
40 | + public string | array $preOrder = []; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @var ?int |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return array|ElementInterface |
59 | 59 | * @throws Exception |
60 | 60 | */ |
61 | - public function find(array $data): array|ElementInterface |
|
61 | + public function find(array $data): array | ElementInterface |
|
62 | 62 | { |
63 | 63 | if (!isset($data['element'])) { |
64 | 64 | throw new Exception('Required parameter `element` was not supplied to `craft.similar.find`.'); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | |
132 | 132 | // Write down elements per site and similar counts |
133 | 133 | $queryConditions[$siteId][] = $elementId; |
134 | - $key = $siteId . '-' . $elementId; |
|
134 | + $key = $siteId.'-'.$elementId; |
|
135 | 135 | $similarCounts[$key] = $config['count']; |
136 | 136 | } |
137 | 137 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $first = false; |
155 | 155 | $query->subQuery->$method(['and', [ |
156 | 156 | 'elements_sites.siteId' => $siteId, |
157 | - 'elements.id' => $elementIds,], |
|
157 | + 'elements.id' => $elementIds, ], |
|
158 | 158 | ]); |
159 | 159 | } |
160 | 160 | }); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | /** @var Element $element */ |
165 | 165 | foreach ($elements as $element) { |
166 | 166 | // The `count` property is added dynamically by our CountBehavior behavior |
167 | - $key = $element->siteId . '-' . $element->id; |
|
167 | + $key = $element->siteId.'-'.$element->id; |
|
168 | 168 | if (!empty($similarCounts[$key])) { |
169 | 169 | /** @phpstan-ignore-next-line */ |
170 | 170 | $element->count = $similarCounts[$key]; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | 'count' => 'DESC', |
191 | 191 | ], $this->preOrder)); |
192 | 192 | } elseif (is_string($this->preOrder)) { |
193 | - $query->query->orderBy('count DESC, ' . str_replace('`', '', $this->preOrder)); |
|
193 | + $query->query->orderBy('count DESC, '.str_replace('`', '', $this->preOrder)); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | $query->query->groupBy(['relations.sourceId', 'elements.id', 'elements_sites.siteId']); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * @param array $criteria |
221 | 221 | * @return ElementQueryInterface |
222 | 222 | */ |
223 | - protected function getElementQuery(string|ElementInterface $elementType, array $criteria): ElementQueryInterface |
|
223 | + protected function getElementQuery(string | ElementInterface $elementType, array $criteria): ElementQueryInterface |
|
224 | 224 | { |
225 | 225 | /** @var string|ElementInterface $elementType */ |
226 | 226 | $query = $elementType::find(); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | * @return array|ElementInterface |
31 | 31 | * @throws Exception |
32 | 32 | */ |
33 | - public function find(array $data): array|ElementInterface |
|
33 | + public function find(array $data): array | ElementInterface |
|
34 | 34 | { |
35 | 35 | return Similar::$plugin->similar->find($data); |
36 | 36 | } |