Passed
Branch v4 (901979)
by Andrew
12:41 queued 05:04
created
Category
ecs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/services/Similar.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/variables/SimilarVariable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.