Passed
Push — main ( 06da90...a6f07e )
by Sergey
07:41
created
src/DataFilterEagerLoadingExtension.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@
 block discarded – undo
16 16
         if(!isset($this->owner->withList)){
17 17
             $this->owner->withList = [];
18 18
         }
19
-        if(!is_array($list)) $list = [$list];
19
+        if(!is_array($list)) {
20
+            $list = [$list];
21
+        }
20 22
         $list = array_map(function($e){return explode('.',$e); },$list);
21 23
         $this->owner->withList = array_merge($this->owner->withList,$list);
22 24
         return EagerLoadedDataList::cloneFrom($this->owner);
Please login to merge, or discard this patch.
src/GridFieldEagerLoadManipulator.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,9 @@  discard block
 block discarded – undo
40 40
                 $export_eager = [];
41 41
                 foreach($export_fields as $field=>$_title) {
42 42
                     $parts = explode('.',$field);
43
-                    if(count($parts) < 2) continue;
43
+                    if(count($parts) < 2) {
44
+                        continue;
45
+                    }
44 46
                     $main = implode('.', array_slice($parts,0,-1));
45 47
                     if(!in_array($main,$eager)){
46 48
                         $eager[] = $main;
@@ -48,7 +50,9 @@  discard block
 block discarded – undo
48 50
                 }
49 51
             }
50 52
         }
51
-        if($eager) return $dataList->with($eager);
53
+        if($eager) {
54
+            return $dataList->with($eager);
55
+        }
52 56
         return $dataList;
53 57
     }
54 58
 }
Please login to merge, or discard this patch.
src/EagerLoadedDataList.php 1 patch
Braces   +17 added lines, -6 removed lines patch added patch discarded remove patch
@@ -52,7 +52,9 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $result = [];
54 54
         foreach($arr as $k => $v){
55
-            if(!isset($result[$v])) $result[$v] = [];
55
+            if(!isset($result[$v])) {
56
+                $result[$v] = [];
57
+            }
56 58
             $result[$v][] = $k;
57 59
         }
58 60
         return $result;
@@ -74,7 +76,9 @@  discard block
 block discarded – undo
74 76
     }
75 77
 
76 78
     public function prepareEagerRelations() {
77
-        if($this->relationsPrepared) return;
79
+        if($this->relationsPrepared) {
80
+            return;
81
+        }
78 82
         $this->relationsPrepared = true;
79 83
         $localClass = $this->dataClass();
80 84
         $config = Config::forClass($localClass);
@@ -222,7 +226,9 @@  discard block
 block discarded – undo
222 226
             foreach($idsQuery as $row){
223 227
                 $relID = $row[$component['childField']];
224 228
                 $localID = $row[$component['parentField']];
225
-                if(!isset($collection[$localID])) $collection[$localID] = [];
229
+                if(!isset($collection[$localID])) {
230
+                    $collection[$localID] = [];
231
+                }
226 232
                 $collection[$localID][] = $relID;
227 233
                 $relListReverted[$relID] = 1;//use ids as keys to avoid
228 234
             }
@@ -318,13 +324,18 @@  discard block
 block discarded – undo
318 324
 
319 325
     public static function EnsureArray($arr, $kfield = null)
320 326
     {
321
-        if(is_array($arr)) return $arr;
327
+        if(is_array($arr)) {
328
+            return $arr;
329
+        }
322 330
         $result = [];
323 331
         foreach($arr as $k => $v){
324 332
             $key = $k;
325 333
             if($kfield!==null) {
326
-                if(is_array($v) && isset($v[$kfield])) $key = $v[$kfield];
327
-                elseif(is_object($v) && isset($v->$kfield)) $key = $v->$kfield;
334
+                if(is_array($v) && isset($v[$kfield])) {
335
+                    $key = $v[$kfield];
336
+                } elseif(is_object($v) && isset($v->$kfield)) {
337
+                    $key = $v->$kfield;
338
+                }
328 339
             }
329 340
             $result[$key] = $v;
330 341
         }
Please login to merge, or discard this patch.