Passed
Pull Request — master (#221)
by Christopher
06:36
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();
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
             throw new InvalidOperationException($msg);
56 56
         }
57 57
         $begin = strpos($code, 'function(');
58
-        $code = substr($code, $begin, strrpos($code, '}') - $begin + 1);
59
-        $lastCode = $code[strlen($code) - 1];
58
+        $code = substr($code, $begin, strrpos($code, '}')-$begin+1);
59
+        $lastCode = $code[strlen($code)-1];
60 60
         if ('}' != $lastCode) {
61 61
             $msg = 'Final character of function definition must be closing brace';
62 62
             throw new InvalidOperationException($msg);
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 ) {
109 109
                     continue;
110 110
                 }
111
-                $relationships[]= $method;
111
+                $relationships[] = $method;
112 112
             }
113 113
         }
114 114
         return $relationships;
Please login to merge, or discard this patch.
src/Models/ObjectMap/Entities/Associations/AssociationStubFactory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     protected static function handleMorphToMany(string $name, Relation $relation, $cacheKey = 'MorphToMany'): AssociationStubBase
139 139
     {
140
-        return self::handleBelongsToMany($name,$relation);
140
+        return self::handleBelongsToMany($name, $relation);
141 141
     }
142 142
 
143 143
     /**
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     private static function getKeyChain(Relation $relation, string $cacheKey) : array
228 228
     {
229 229
         $fields = self::$fieldOrderCache[$cacheKey];
230
-        $getter =  function () use ($fields) {
230
+        $getter = function () use ($fields) {
231 231
             $carry = [];
232 232
             foreach ($fields as $item) {
233 233
                 $v = $this->{$item};
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
 
246 246
     private static $fieldOrderCache = [
247 247
         'BelongsTo' => ['foreignKey', 'ownerKey'],
248
-        'BelongsToMany' => ['parentKey','foreignPivotKey','relatedPivotKey','relatedKey'],
249
-        'HasOneOrMany' => ['localKey', 'foreignKey' ],
248
+        'BelongsToMany' => ['parentKey', 'foreignPivotKey', 'relatedPivotKey', 'relatedKey'],
249
+        'HasOneOrMany' => ['localKey', 'foreignKey'],
250 250
         'HasManyThrough' => ['localKey', 'firstKey', 'secondLocalKey', 'secondKey'],
251
-        'MorphToMany' => ['parentKey','foreignPivotKey','morphType', 'relatedPivotKey','relatedKey'],
251
+        'MorphToMany' => ['parentKey', 'foreignPivotKey', 'morphType', 'relatedPivotKey', 'relatedKey'],
252 252
         'MorphTo' => ['foreignKey', 'morphType', 'ownerKey'],
253
-        'MorphOneOrMany' => ['foreignKey', 'morphType', 'localKey' ],
253
+        'MorphOneOrMany' => ['foreignKey', 'morphType', 'localKey'],
254 254
 
255 255
     ];
256 256
 }
Please login to merge, or discard this patch.