Test Failed
Pull Request — master (#85)
by Alex
05:36
created
src/Providers/MetadataProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 class MetadataProvider extends MetadataBaseProvider
15 15
 {
16
-    protected $multConstraints = [ '0..1' => ['1'], '1' => ['0..1', '*'], '*' => ['1', '*']];
16
+    protected $multConstraints = ['0..1' => ['1'], '1' => ['0..1', '*'], '*' => ['1', '*']];
17 17
     protected static $metaNAMESPACE = 'Data';
18 18
 
19 19
     /**
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         $knownKeys = array_keys($knownSide);
192 192
         $unknownKeys = array_keys($unknownSide);
193 193
         $dualKeys = array_intersect($knownKeys, $unknownKeys);
194
-        assert(count($hooks) == (count($unknownKeys) + count($knownKeys) - count($dualKeys)));
194
+        assert(count($hooks) == (count($unknownKeys)+count($knownKeys)-count($dualKeys)));
195 195
         // if either list is empty, bail out - there's nothing to do
196 196
         if (0 === count($knownSide) || 0 === count($unknownSide)) {
197 197
             return [];
Please login to merge, or discard this patch.
src/Models/MetadataTrait.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -301,17 +301,17 @@
 block discarded – undo
301 301
                         $lastCode = $code[strlen($code) - 1];
302 302
                         assert('}' == $lastCode, 'Final character of function definition must be closing brace');
303 303
                         foreach ([
304
-                                     'hasMany',
305
-                                     'hasManyThrough',
306
-                                     'belongsToMany',
307
-                                     'hasOne',
308
-                                     'belongsTo',
309
-                                     'morphOne',
310
-                                     'morphTo',
311
-                                     'morphMany',
312
-                                     'morphToMany',
313
-                                     'morphedByMany'
314
-                                 ] as $relation) {
304
+                                        'hasMany',
305
+                                        'hasManyThrough',
306
+                                        'belongsToMany',
307
+                                        'hasOne',
308
+                                        'belongsTo',
309
+                                        'morphOne',
310
+                                        'morphTo',
311
+                                        'morphMany',
312
+                                        'morphToMany',
313
+                                        'morphedByMany'
314
+                                    ] as $relation) {
315 315
                             $search = '$this->' . $relation . '(';
316 316
                             if ($pos = stripos($code, $search)) {
317 317
                                 //Resolve the relation's model to a Relation object.
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                         $reflection = new \ReflectionMethod($model, $method);
285 285
 
286 286
                         $file = new \SplFileObject($reflection->getFileName());
287
-                        $file->seek($reflection->getStartLine() - 1);
287
+                        $file->seek($reflection->getStartLine()-1);
288 288
                         $code = '';
289 289
                         while ($file->key() < $reflection->getEndLine()) {
290 290
                             $code .= $file->current();
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
                             'Function definition must have keyword \'function\''
298 298
                         );
299 299
                         $begin = strpos($code, 'function(');
300
-                        $code = substr($code, $begin, strrpos($code, '}') - $begin + 1);
301
-                        $lastCode = $code[strlen($code) - 1];
300
+                        $code = substr($code, $begin, strrpos($code, '}')-$begin+1);
301
+                        $lastCode = $code[strlen($code)-1];
302 302
                         assert('}' == $lastCode, 'Final character of function definition must be closing brace');
303 303
                         foreach ([
304 304
                                      'hasMany',
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
                         break;
464 464
                     }
465 465
                 }
466
-                assert(in_array($fkMethodName, $methodList), 'Selected method, '.$fkMethodName.', not in method list');
466
+                assert(in_array($fkMethodName, $methodList), 'Selected method, ' . $fkMethodName . ', not in method list');
467 467
                 $rkMethodName = 'getQualifiedRelatedPivotKeyName';
468 468
                 foreach ($rkList as $option) {
469 469
                     if (in_array($option, $methodList)) {
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                         break;
472 472
                     }
473 473
                 }
474
-                assert(in_array($rkMethodName, $methodList), 'Selected method, '.$rkMethodName.', not in method list');
474
+                assert(in_array($rkMethodName, $methodList), 'Selected method, ' . $rkMethodName . ', not in method list');
475 475
                 $line = ['fk' => $fkMethodName, 'rk' => $rkMethodName];
476 476
                 static::$methodPrimary[get_class($foo)] = $line;
477 477
             }
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
                         break;
501 501
                     }
502 502
                 }
503
-                assert(in_array($fkMethodName, $methodList), 'Selected method, '.$fkMethodName.', not in method list');
503
+                assert(in_array($fkMethodName, $methodList), 'Selected method, ' . $fkMethodName . ', not in method list');
504 504
                 $rkMethodName = 'getQualifiedParentKeyName';
505 505
                 foreach ($rkList as $option) {
506 506
                     if (in_array($option, $methodList)) {
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
                         break;
509 509
                     }
510 510
                 }
511
-                assert(in_array($rkMethodName, $methodList), 'Selected method, '.$rkMethodName.', not in method list');
511
+                assert(in_array($rkMethodName, $methodList), 'Selected method, ' . $rkMethodName . ', not in method list');
512 512
                 $line = ['fk' => $fkMethodName, 'rk' => $rkMethodName];
513 513
                 static::$methodAlternate[get_class($foo)] = $line;
514 514
             }
@@ -555,10 +555,10 @@  discard block
 block discarded – undo
555 555
 
556 556
             $keyRaw = $isBelong ? $foo->$fkMethodName() : $foo->$fkMethodAlternate();
557 557
             $keySegments = explode('.', $keyRaw);
558
-            $keyName = $keySegments[count($keySegments) - 1];
558
+            $keyName = $keySegments[count($keySegments)-1];
559 559
             $localRaw = $isBelong ? $foo->$rkMethodName() : $foo->$rkMethodAlternate();
560 560
             $localSegments = explode('.', $localRaw);
561
-            $localName = $localSegments[count($localSegments) - 1];
561
+            $localName = $localSegments[count($localSegments)-1];
562 562
             $first = $keyName;
563 563
             $last = $localName;
564 564
             $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ);
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
 
585 585
             $keyName = $isBelong ? $foo->$fkMethodName() : $foo->$fkMethodAlternate();
586 586
             $keySegments = explode('.', $keyName);
587
-            $keyName = $keySegments[count($keySegments) - 1];
587
+            $keyName = $keySegments[count($keySegments)-1];
588 588
             $localRaw = $isBelong ? $foo->$rkMethodName() : $foo->$rkMethodAlternate();
589 589
             $localSegments = explode('.', $localRaw);
590
-            $localName = $localSegments[count($localSegments) - 1];
590
+            $localName = $localSegments[count($localSegments)-1];
591 591
             $first = $isBelong ? $localName : $keyName;
592 592
             $last = $isBelong ? $keyName : $localName;
593 593
             $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ);
@@ -611,10 +611,10 @@  discard block
 block discarded – undo
611 611
 
612 612
             $keyRaw = $isMany ? $foo->$fkMethodName() : $foo->$fkMethodAlternate();
613 613
             $keySegments = explode('.', $keyRaw);
614
-            $keyName = $keySegments[count($keySegments) - 1];
614
+            $keyName = $keySegments[count($keySegments)-1];
615 615
             $localRaw = $isMany ? $foo->$rkMethodName() : $foo->$rkMethodAlternate();
616 616
             $localSegments = explode('.', $localRaw);
617
-            $localName = $localSegments[count($localSegments) - 1];
617
+            $localName = $localSegments[count($localSegments)-1];
618 618
             $first = $isMany ? $keyName : $localName;
619 619
             $last = $isMany ? $localName : $keyName;
620 620
             $this->addRelationsHook($hooks, $first, $property, $last, $mult, $targ);
@@ -637,10 +637,10 @@  discard block
 block discarded – undo
637 637
 
638 638
             $keyRaw = $isMany ? $foo->$fkMethodName() : $foo->$fkMethodAlternate();
639 639
             $keySegments = explode('.', $keyRaw);
640
-            $keyName = $keySegments[count($keySegments) - 1];
640
+            $keyName = $keySegments[count($keySegments)-1];
641 641
             $localRaw = $isMany ? $foo->$rkMethodName() : $foo->$rkMethodAlternate();
642 642
             $localSegments = explode('.', $localRaw);
643
-            $localName = $localSegments[count($localSegments) - 1];
643
+            $localName = $localSegments[count($localSegments)-1];
644 644
 
645 645
             $first = $keyName;
646 646
             $last = (isset($localName) && '' != $localName) ? $localName : $foo->getRelated()->getKeyName();
Please login to merge, or discard this patch.