Passed
Pull Request — master (#221)
by Christopher
06:28 queued 01:03
created
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.
src/Models/MetadataRelationsTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,6 +32,6 @@
 block discarded – undo
32 32
      */
33 33
     public function getRelationships()
34 34
     {
35
-        return static::$relationNames =  static::$relationNames ?? ModelReflectionHelper::getRelationshipsFromMethods($this);
35
+        return static::$relationNames = static::$relationNames ?? ModelReflectionHelper::getRelationshipsFromMethods($this);
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
src/Models/ModelReflectionHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $fileName = $method->getFileName();
35 35
 
36 36
         $file = new \SplFileObject($fileName);
37
-        $file->seek($method->getStartLine() - 1);
37
+        $file->seek($method->getStartLine()-1);
38 38
         $code = '';
39 39
         while ($file->key() < $method->getEndLine()) {
40 40
             $code .= $file->current();
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         $code = trim(preg_replace('/\s\s+/', '', $code));
45 45
         $begin = strpos($code, 'function(');
46
-        $code = substr($code, $begin, strrpos($code, '}') - $begin + 1);
46
+        $code = substr($code, $begin, strrpos($code, '}')-$begin+1);
47 47
         return $code;
48 48
     }
49 49
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                 ) {
85 85
                     continue;
86 86
                 }
87
-                $relationships[]= $method;
87
+                $relationships[] = $method;
88 88
             }
89 89
         }
90 90
         return $relationships;
Please login to merge, or discard this patch.