Passed
Pull Request — master (#221)
by Christopher
06:21
created
src/Models/ObjectMap/Entities/Associations/AssociationStubFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     private static function getKeyChain(Relation $relation, string $cacheKey) : array
241 241
     {
242 242
         $fields = self::$fieldOrderCache[$cacheKey];
243
-        $getter =  function () use ($fields) {
243
+        $getter = function () use ($fields) {
244 244
             $carry = [];
245 245
             foreach ($fields as $item) {
246 246
                 $v = $this->{$item};
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
 
259 259
     private static $fieldOrderCache = [
260 260
         'BelongsTo' => ['foreignKey', 'ownerKey'],
261
-        'BelongsToMany' => ['parentKey','foreignPivotKey','relatedPivotKey','relatedKey'],
262
-        'HasOneOrMany' => ['localKey', 'foreignKey' ],
261
+        'BelongsToMany' => ['parentKey', 'foreignPivotKey', 'relatedPivotKey', 'relatedKey'],
262
+        'HasOneOrMany' => ['localKey', 'foreignKey'],
263 263
         'HasManyThrough' => ['localKey', 'firstKey', 'secondLocalKey', 'secondKey'],
264
-        'MorphToMany' => ['parentKey','foreignPivotKey','morphType', 'relatedPivotKey','relatedKey'],
264
+        'MorphToMany' => ['parentKey', 'foreignPivotKey', 'morphType', 'relatedPivotKey', 'relatedKey'],
265 265
         'MorphTo' => ['foreignKey', 'morphType', 'ownerKey'],
266
-        'MorphOneOrMany' => ['foreignKey', 'morphType', 'localKey' ],
266
+        'MorphOneOrMany' => ['foreignKey', 'morphType', 'localKey'],
267 267
 
268 268
     ];
269 269
 }
Please login to merge, or discard this patch.
src/Models/ObjectMap/Entities/Associations/AssociationStubMonomorphic.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,13 +22,13 @@
 block discarded – undo
22 22
         }
23 23
         $thisChain = $this->getThroughFieldChain();
24 24
         $otherChain = $otherStub->getThroughFieldChain();
25
-        $thisThroughCount = count($thisChain) - 1;
26
-        $otherThroughCount = count($otherChain) - 1;
25
+        $thisThroughCount = count($thisChain)-1;
26
+        $otherThroughCount = count($otherChain)-1;
27 27
         if ($thisThroughCount !== $otherThroughCount) {
28 28
             return false;
29 29
         }
30
-        for ($i=0; $i <= $thisThroughCount;++$i) {
31
-            if ($thisChain[$i] !== $otherChain[$otherThroughCount -$i]) {
30
+        for ($i = 0; $i <= $thisThroughCount; ++$i) {
31
+            if ($thisChain[$i] !== $otherChain[$otherThroughCount-$i]) {
32 32
                 return false;
33 33
             }
34 34
         }
Please login to merge, or discard this patch.
src/Models/MetadataRelationsTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $fileName = $method->getFileName();
43 43
 
44 44
         $file = new \SplFileObject($fileName);
45
-        $file->seek($method->getStartLine() - 1);
45
+        $file->seek($method->getStartLine()-1);
46 46
         $code = '';
47 47
         while ($file->key() < $method->getEndLine()) {
48 48
             $code .= $file->current();
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 
52 52
         $code = trim(preg_replace('/\s\s+/', '', $code));
53 53
         $begin = strpos($code, 'function(');
54
-        $code = substr($code, $begin, strrpos($code, '}') - $begin + 1);
55
-        $lastCode = $code[strlen($code) - 1];
54
+        $code = substr($code, $begin, strrpos($code, '}')-$begin+1);
55
+        $lastCode = $code[strlen($code)-1];
56 56
 
57 57
         return $code;
58 58
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                 ) {
102 102
                     continue;
103 103
                 }
104
-                $relationships[]= $method;
104
+                $relationships[] = $method;
105 105
             }
106 106
         }
107 107
         return $relationships;
Please login to merge, or discard this patch.