Passed
Pull Request — master (#221)
by Christopher
06:51 queued 45s
created
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.
src/Models/ObjectMap/Entities/Associations/AssociationStubFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     private static function getKeyChain(Relation $relation, string $cacheKey) : array
240 240
     {
241 241
         $fields = self::$fieldOrderCache[$cacheKey];
242
-        $getter =  function () use ($fields) {
242
+        $getter = function () use ($fields) {
243 243
             $carry = [];
244 244
             foreach ($fields as $item) {
245 245
                 $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
         'inverse' => ['inverse'], // TODO: currently used to get inverse, should be removed when morephtomany is fixed
268 268
 
269 269
     ];
Please login to merge, or discard this patch.