Passed
Pull Request — master (#9)
by
unknown
04:13
created
src/EagerLoadedDataList.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         return array_filter(
66 66
             $this->withList,
67
-            function ($dep) use ($list) {
67
+            function($dep) use ($list) {
68 68
                 return array_key_exists($dep[0], $list);
69 69
             }
70 70
         );
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             $fields[] = "\"{$dep}ID\"";
124 124
         }
125 125
         $table = DataObject::getSchema()->tableName($this->dataClass);
126
-        $data = new SQLSelect($fields, '"' . $table . '"', ['"ID" IN (' . implode(',', $ids) . ')']);
126
+        $data = new SQLSelect($fields, '"'.$table.'"', ['"ID" IN ('.implode(',', $ids).')']);
127 127
         $data = Utils::EnsureArray($data->execute(), 'ID');
128 128
 
129 129
         foreach ($withHasOnes as $depSeq) {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             while (count($uniqueIDs)) {
142 142
                 $IDsubset = array_splice($uniqueIDs, 0, self::ID_LIMIT);
143 143
                 $result = DataObject::get($depClass)->filter('ID', $IDsubset);
144
-                if (count($depSeq)>1) {
144
+                if (count($depSeq) > 1) {
145 145
                     $result = $result
146 146
                         ->with(implode('.', array_slice($depSeq, 1)));
147 147
                 }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                 'map' => [],
179 179
             ];
180 180
             $result = DataObject::get($depClass)->filter($depKey, $data);
181
-            if (count($depSeq)>1) {
181
+            if (count($depSeq) > 1) {
182 182
                 $result = $result
183 183
                     ->with(implode('.', array_slice($depSeq, 1)));
184 184
             }
@@ -219,12 +219,12 @@  discard block
 block discarded – undo
219 219
 
220 220
             $idsQuery = SQLSelect::create(
221 221
                 [
222
-                    '"' . $component['childField'] . '"',
223
-                    '"' . $component['parentField'] . '"',
222
+                    '"'.$component['childField'].'"',
223
+                    '"'.$component['parentField'].'"',
224 224
                 ],
225
-                '"' . $table . '"',
225
+                '"'.$table.'"',
226 226
                 [
227
-                    '"' . $component['parentField'] . '" IN (' . implode(',', $data) . ')'
227
+                    '"'.$component['parentField'].'" IN ('.implode(',', $data).')'
228 228
                 ]
229 229
             )->execute();
230 230
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                 $depClass = $depClass['through'] ?? $depClass;
245 245
 
246 246
                 $result = DataObject::get($depClass)->filter('ID', array_keys($relListReverted));
247
-                if (count($depSeq)>1) {
247
+                if (count($depSeq) > 1) {
248 248
                     $result = $result
249 249
                         ->with(implode('.', array_slice($depSeq, 1)));
250 250
                 }
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
             }
286 286
             if (!method_exists($item, 'addEagerRelation')) {
287 287
                 throw new EagerLoadingException(
288
-                    "Model {$item->ClassName} must include " .
289
-                    EagerLoaderMultiAccessor::class .
288
+                    "Model {$item->ClassName} must include ".
289
+                    EagerLoaderMultiAccessor::class.
290 290
                     " trait to use eager loading for \$has_many"
291 291
                 );
292 292
             }
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
             }
309 309
             if (!method_exists($item, 'addEagerRelation')) {
310 310
                 throw new EagerLoadingException(
311
-                    "Model {$item->ClassName} must include " .
312
-                    EagerLoaderMultiAccessor::class .
311
+                    "Model {$item->ClassName} must include ".
312
+                    EagerLoaderMultiAccessor::class.
313 313
                     " trait to use eager loading for \$many_many"
314 314
                 );
315 315
             }
Please login to merge, or discard this patch.