Passed
Pull Request — master (#226)
by Christopher
04:54
created
src/Models/ObjectMap/Entities/Associations/AssociationStubPolymorphic.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
             !$thatNull) &&
49 49
             ($this->getBaseType() !== $otherStub->getTargType() ||
50 50
             $otherStub->getBaseType() !== $this->getTargType())
51
-        ){
51
+        ) {
52 52
             return false;
53 53
         }
54 54
 
Please login to merge, or discard this patch.
src/Models/MetadataRelationshipContainer.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         if($baseType === null ||
65 65
            !array_key_exists($baseType, $this->stubs) ||
66
-           !array_key_exists($targetType, $this->stubs[$baseType])){
66
+           !array_key_exists($targetType, $this->stubs[$baseType])) {
67 67
             return [];
68 68
         }
69 69
         return $this->stubs[$baseType][$targetType];
@@ -86,7 +86,8 @@  discard block
 block discarded – undo
86 86
         $this->addAssocations($assocations);
87 87
     }
88 88
 
89
-    private function addAssocations(array $additionals){
89
+    private function addAssocations(array $additionals)
90
+    {
90 91
         $this->assocations = array_merge($this->assocations, $additionals);
91 92
     }
92 93
 
@@ -111,7 +112,7 @@  discard block
 block discarded – undo
111 112
         }
112 113
         $entites = $this->entities[$className];
113 114
         $relation = $entites->getStubs()[$relName];
114
-        return array_reduce($relation->getAssocations(), function($carry, Association $item) use ($relation){
115
+        return array_reduce($relation->getAssocations(), function($carry, Association $item) use ($relation) {
115 116
             $carry[] = ($item->getFirst() === $relation) ? $item->getLast() : $item->getFirst();
116 117
             return $carry;
117 118
         },[]);
@@ -125,11 +126,11 @@  discard block
 block discarded – undo
125 126
      */
126 127
     public function getRelationsByClass(string $className): array
127 128
     {
128
-        if(empty($this->assocations)){
129
+        if(empty($this->assocations)) {
129 130
             $this->buildAssocations();
130 131
         }
131 132
         $this->checkClassExists($className);
132
-        return array_reduce($this->entities[$className]->getStubs(), function($carry, AssociationStubBase $item){
133
+        return array_reduce($this->entities[$className]->getStubs(), function($carry, AssociationStubBase $item) {
133 134
             return array_merge($carry, $item->getAssocations());
134 135
         },[]);
135 136
     }
Please login to merge, or discard this patch.
src/Models/ObjectMap/Entities/Associations/AssociationFactory.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         $first = -1 === $stubOne->compare($stubTwo);
23 23
 
24 24
         $association = new AssociationMonomorphic();
25
-        if($stubOne->getTargType() == null && self::$marshalPolymorphics){
25
+        if($stubOne->getTargType() == null && self::$marshalPolymorphics) {
26 26
             $stubOne->addAssociation($association);
27 27
             $stubOne = self::marshalPolyToMono($stubOne, $stubTwo);
28 28
         }
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 
51 51
     private static function checkAssocations(AssociationStubBase $stubOne, AssociationStubBase $stubTwo): ?Association{
52 52
         $assocOne = $stubOne->getAssocations();
53
-        foreach($assocOne as $association){
53
+        foreach($assocOne as $association) {
54 54
             $isFirst = $association->getFirst() === $stubOne;
55
-            if($association->{$isFirst ? 'getLast' : 'getFirst'}() == $stubTwo){
55
+            if($association->{$isFirst ? 'getLast' : 'getFirst'}() == $stubTwo) {
56 56
                 return $association;
57 57
             }
58 58
         }
Please login to merge, or discard this patch.
src/Models/ObjectMap/Entities/Associations/AssociationStubBase.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             }
203 203
         }
204 204
 
205
-        if(null === $this->throughFieldChain){
205
+        if(null === $this->throughFieldChain) {
206 206
             return false;
207 207
         }
208 208
         return (null === $targType) === (null === $foreignField);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         if(
286 286
             ($thisFirst || $otherFirst) &&
287 287
             !($thisFirst && $otherFirst)
288
-            ){
288
+            ) {
289 289
             return $thisFirst ? -1 : 1;
290 290
         }
291 291
         $thisClass  = get_class($this);
Please login to merge, or discard this patch.