Passed
Pull Request — master (#11)
by Loz
12:53
created
src/EagerLoadedDataList.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         return array_filter(
67 67
             $this->withList,
68
-            function ($dep) use ($list) {
68
+            function($dep) use ($list) {
69 69
                 return array_key_exists($dep[0], $list);
70 70
             }
71 71
         );
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $fields[] = "\"{$dep}ID\"";
125 125
         }
126 126
         $table = DataObject::getSchema()->tableName($this->dataClass);
127
-        $data = new SQLSelect($fields, '"' . $table . '"', ['"ID" IN (' . implode(',', $ids) . ')']);
127
+        $data = new SQLSelect($fields, '"'.$table.'"', ['"ID" IN ('.implode(',', $ids).')']);
128 128
         $data = Utils::EnsureArray($data->execute(), 'ID');
129 129
 
130 130
         foreach ($withHasOnes as $depSeq) {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 $IDsubset = array_splice($uniqueIDs, 0, self::ID_LIMIT);
144 144
                 $result = DataObject::get($depClass)->filter('ID', $IDsubset);
145 145
                 $this->extend('onEagerLoadHasOneMany', $result, $data, $depSeq, $withHasOnes);
146
-                if (count($depSeq)>1) {
146
+                if (count($depSeq) > 1) {
147 147
                     $result = $result
148 148
                         ->with(implode('.', array_slice($depSeq, 1)));
149 149
                 }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             ];
182 182
             $result = DataObject::get($depClass)->filter($depKey, $data);
183 183
             $this->extend('onEagerLoadHasMany', $result, $depKey, $data, $depSeq, $withHasManys);
184
-            if (count($depSeq)>1) {
184
+            if (count($depSeq) > 1) {
185 185
                 $result = $result
186 186
                     ->with(implode('.', array_slice($depSeq, 1)));
187 187
             }
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 
223 223
                 $table = DataObject::getSchema()->tableName($throughClass);
224 224
 
225
-                $childField = $depData['to']. 'ID';
226
-                $parentField = $depData['from']. 'ID';
225
+                $childField = $depData['to'].'ID';
226
+                $parentField = $depData['from'].'ID';
227 227
             } else {
228 228
                 $depClass = $depData;
229 229
                 $component = $schema->manyManyComponent($localClass, $dep);
@@ -240,12 +240,12 @@  discard block
 block discarded – undo
240 240
 
241 241
             $idsQuery = SQLSelect::create(
242 242
                 [
243
-                    '"' . $childField . '"',
244
-                    '"' . $parentField . '"',
243
+                    '"'.$childField.'"',
244
+                    '"'.$parentField.'"',
245 245
                 ],
246
-                '"' . $table . '"',
246
+                '"'.$table.'"',
247 247
                 [
248
-                    '"' . $parentField . '" IN (' . implode(',', $data) . ')'
248
+                    '"'.$parentField.'" IN ('.implode(',', $data).')'
249 249
                 ]
250 250
             )->execute();
251 251
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
             if (count($relListReverted)) {
265 265
                 $result = DataObject::get($depClass)->filter('ID', array_keys($relListReverted));
266 266
                 $this->extend('onEagerLoadManyMany', $result, $data, $depSeq, $withManyManys);
267
-                if (count($depSeq)>1) {
267
+                if (count($depSeq) > 1) {
268 268
                     $result = $result
269 269
                         ->with(implode('.', array_slice($depSeq, 1)));
270 270
                 }
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
             }
306 306
             if (!method_exists($item, 'addEagerRelation')) {
307 307
                 throw new EagerLoadingException(
308
-                    "Model {$item->ClassName} must include " .
309
-                    EagerLoaderMultiAccessor::class .
308
+                    "Model {$item->ClassName} must include ".
309
+                    EagerLoaderMultiAccessor::class.
310 310
                     " trait to use eager loading for \$has_many"
311 311
                 );
312 312
             }
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
             }
329 329
             if (!method_exists($item, 'addEagerRelation')) {
330 330
                 throw new EagerLoadingException(
331
-                    "Model {$item->ClassName} must include " .
332
-                    EagerLoaderMultiAccessor::class .
331
+                    "Model {$item->ClassName} must include ".
332
+                    EagerLoaderMultiAccessor::class.
333 333
                     " trait to use eager loading for \$many_many"
334 334
                 );
335 335
             }
Please login to merge, or discard this patch.