Passed
Pull Request — master (#221)
by Christopher
10:14 queued 05:03
created
src/Models/ObjectMap/Entities/Associations/AssociationStubFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     private static function getKeyChain(Relation $relation, string $cacheKey) : array
229 229
     {
230 230
         $fields = self::$fieldOrderCache[$cacheKey];
231
-        $getter =  function () use ($fields) {
231
+        $getter = function () use ($fields) {
232 232
             $carry = [];
233 233
             foreach ($fields as $item) {
234 234
                 $v = $this->{$item};
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 
247 247
     private static $fieldOrderCache = [
248 248
         'BelongsTo' => ['ownerKey', 'foreignKey'],
249
-        'BelongsToMany' => ['parentKey','foreignPivotKey','relatedPivotKey','relatedKey'],
250
-        'HasOneOrMany' => ['localKey', 'foreignKey' ],
249
+        'BelongsToMany' => ['parentKey', 'foreignPivotKey', 'relatedPivotKey', 'relatedKey'],
250
+        'HasOneOrMany' => ['localKey', 'foreignKey'],
251 251
         'HasManyThrough' => ['localKey', 'firstKey', 'secondLocalKey', 'secondKey'],
252 252
 
253 253
     ];
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();
@@ -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.