Passed
Branch main (a0bf98)
by Sergey
03:34 queued 01:18
created
src/Utils.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,11 @@
 block discarded – undo
13 13
         foreach ($arr as $k => $v){
14 14
             $key = $k;
15 15
             if ($kfield!==null) {
16
-                if (is_array($v) && isset($v[$kfield])) $key = $v[$kfield];
17
-                elseif (is_object($v) && isset($v->$kfield)) $key = $v->$kfield;
16
+                if (is_array($v) && isset($v[$kfield])) {
17
+                    $key = $v[$kfield];
18
+                } elseif (is_object($v) && isset($v->$kfield)) {
19
+                    $key = $v->$kfield;
20
+                }
18 21
             }
19 22
             $result[$key] = $v;
20 23
         }
Please login to merge, or discard this patch.
src/EagerLoadedDataList.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@  discard block
 block discarded – undo
58 58
     private $relationsPrepared = false;
59 59
 
60 60
     public function prepareEagerRelations() {
61
-        if($this->relationsPrepared) return;
61
+        if($this->relationsPrepared) {
62
+            return;
63
+        }
62 64
         $this->relationsPrepared = true;
63 65
         $localClass = $this->dataClass();
64 66
         $config = Config::forClass($localClass);
@@ -206,7 +208,9 @@  discard block
 block discarded – undo
206 208
             foreach($idsQuery as $row){
207 209
                 $relID = $row[$component['childField']];
208 210
                 $localID = $row[$component['parentField']];
209
-                if(!isset($collection[$localID])) $collection[$localID] = [];
211
+                if(!isset($collection[$localID])) {
212
+                    $collection[$localID] = [];
213
+                }
210 214
                 $collection[$localID][] = $relID;
211 215
                 $relListReverted[$relID] = 1;//use ids as keys to avoid
212 216
             }
Please login to merge, or discard this patch.