Completed
Push — master ( 0009c6...1fb800 )
by Marco
25s queued 10s
created
src/Reflection/Exception/Uncloneable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 {
7 7
     public static function fromClass(string $className) : self
8 8
     {
9
-        return new self('Trying to clone an uncloneable object of class ' . $className);
9
+        return new self('Trying to clone an uncloneable object of class '.$className);
10 10
     }
11 11
 }
Please login to merge, or discard this patch.
src/SourceLocator/Type/AutoloadSourceLocator.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -26,6 +26,7 @@
 block discarded – undo
26 26
     /**
27 27
      * Note: the constructor has been made a 0-argument constructor because `\stream_wrapper_register`
28 28
      *       is a piece of trash, and doesn't accept instances, just class names.
29
+     * @param AstLocator $astLocator
29 30
      */
30 31
     public function __construct(?AstLocator $astLocator = null)
31 32
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         $potentiallyLocatedFile = $this->attemptAutoloadForIdentifier($identifier);
75 75
 
76
-        if (! ($potentiallyLocatedFile && file_exists($potentiallyLocatedFile))) {
76
+        if (!($potentiallyLocatedFile && file_exists($potentiallyLocatedFile))) {
77 77
             return null;
78 78
         }
79 79
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         if (class_exists($className, false) || interface_exists($className, false) || trait_exists($className, false)) {
122 122
             $filename = (new ReflectionClass($className))->getFileName();
123 123
 
124
-            if (! is_string($filename)) {
124
+            if (!is_string($filename)) {
125 125
                 return null;
126 126
             }
127 127
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
         self::$autoloadLocatedFile = null;
132 132
         self::$currentAstLocator   = $this->astLocator; // passing the locator on to the implicitly instantiated `self`
133
-        $previousErrorHandler      = set_error_handler(static function () : void {
133
+        $previousErrorHandler      = set_error_handler(static function() : void {
134 134
         });
135 135
         stream_wrapper_unregister('file');
136 136
         stream_wrapper_register('file', self::class);
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
      */
151 151
     private function locateFunctionByName(string $functionName) : ?string
152 152
     {
153
-        if (! function_exists($functionName)) {
153
+        if (!function_exists($functionName)) {
154 154
             return null;
155 155
         }
156 156
 
157 157
         $reflection         = new ReflectionFunction($functionName);
158 158
         $reflectionFileName = $reflection->getFileName();
159 159
 
160
-        if (! is_string($reflectionFileName)) {
160
+        if (!is_string($reflectionFileName)) {
161 161
             return null;
162 162
         }
163 163
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         stream_wrapper_restore('file');
205 205
 
206 206
         if ($flags & STREAM_URL_STAT_QUIET) {
207
-            set_error_handler(static function () {
207
+            set_error_handler(static function() {
208 208
                 // Use native error handler
209 209
                 return false;
210 210
             });
Please login to merge, or discard this patch.
demo/basic-reflection/example3.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 // Loading a specific file (not from autoloader)
4 4
 
5
-require_once __DIR__ . '/../../vendor/autoload.php';
5
+require_once __DIR__.'/../../vendor/autoload.php';
6 6
 
7 7
 use Roave\BetterReflection\BetterReflection;
8 8
 use Roave\BetterReflection\Reflector\ClassReflector;
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 use Roave\BetterReflection\SourceLocator\Type\SingleFileSourceLocator;
11 11
 
12 12
 $reflector = new ClassReflector(new AggregateSourceLocator([
13
-    new SingleFileSourceLocator(__DIR__ . '/assets/MyClass.php', (new BetterReflection())->astLocator()),
13
+    new SingleFileSourceLocator(__DIR__.'/assets/MyClass.php', (new BetterReflection())->astLocator()),
14 14
 ]));
15 15
 
16 16
 $reflection = $reflector->reflect('MyClass');
17 17
 
18
-echo $reflection->getName() . "\n"; // MyClass
19
-echo ($reflection->getProperty('foo')->isPrivate() === true ? 'private' : 'not private') . "\n"; // private
20
-echo $reflection->getProperty('foo')->getDocBlockTypeStrings()[0] . "\n"; // string
21
-echo $reflection->getMethod('getFoo')->getDocBlockReturnTypes()[0]->__toString() . "\n"; // string
18
+echo $reflection->getName()."\n"; // MyClass
19
+echo ($reflection->getProperty('foo')->isPrivate() === true ? 'private' : 'not private')."\n"; // private
20
+echo $reflection->getProperty('foo')->getDocBlockTypeStrings()[0]."\n"; // string
21
+echo $reflection->getMethod('getFoo')->getDocBlockReturnTypes()[0]->__toString()."\n"; // string
22 22
 
Please login to merge, or discard this patch.
demo/monkey-patching/index.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__ . '/../../vendor/autoload.php';
3
+require_once __DIR__.'/../../vendor/autoload.php';
4 4
 
5 5
 use Roave\BetterReflection\BetterReflection;
6 6
 use Roave\BetterReflection\Reflector\ClassReflector;
@@ -12,14 +12,14 @@  discard block
 block discarded – undo
12 12
 
13 13
 // Create the reflection first (without loading)
14 14
 $classInfo = (new ClassReflector(
15
-    new SingleFileSourceLocator(__DIR__ . '/MyClass.php', (new BetterReflection())->astLocator())
15
+    new SingleFileSourceLocator(__DIR__.'/MyClass.php', (new BetterReflection())->astLocator())
16 16
 ))->reflect('MyClass');
17 17
 $loader->addClass($classInfo);
18 18
 
19 19
 // Override the body...!
20
-$classInfo->getMethod('foo')->setBodyFromClosure(function () {
20
+$classInfo->getMethod('foo')->setBodyFromClosure(function() {
21 21
     return 4;
22 22
 });
23 23
 
24 24
 $c = new MyClass();
25
-echo $c->foo() . "\n"; // should be 4...!?!??
25
+echo $c->foo()."\n"; // should be 4...!?!??
Please login to merge, or discard this patch.
src/Reflection/Adapter/ReflectionProperty.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 
6 6
 use ReflectionException as CoreReflectionException;
7 7
 use ReflectionProperty as CoreReflectionProperty;
8
-use Roave\BetterReflection\Reflection\Exception\NoObjectProvided;
9 8
 use Roave\BetterReflection\Reflection\Exception\NotAnObject;
10 9
 use Roave\BetterReflection\Reflection\ReflectionProperty as BetterReflectionProperty;
11 10
 use Throwable;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function getValue($object = null)
56 56
     {
57
-        if (! $this->isAccessible()) {
57
+        if (!$this->isAccessible()) {
58 58
             throw new CoreReflectionException('Property not accessible');
59 59
         }
60 60
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function setValue($object, $value = null)
74 74
     {
75
-        if (! $this->isAccessible()) {
75
+        if (!$this->isAccessible()) {
76 76
             throw new CoreReflectionException('Property not accessible');
77 77
         }
78 78
 
Please login to merge, or discard this patch.
demo/basic-reflection/example1.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@
 block discarded – undo
2 2
 
3 3
 // Load a standard (internal) class
4 4
 
5
-require_once __DIR__ . '/../../vendor/autoload.php';
5
+require_once __DIR__.'/../../vendor/autoload.php';
6 6
 
7 7
 use Roave\BetterReflection\BetterReflection;
8 8
 
9 9
 $reflection = (new BetterReflection())->classReflector()->reflect(\stdClass::class);
10 10
 
11
-echo $reflection->getName() . "\n"; // stdClass
12
-echo ($reflection->isInternal() === true ? 'internal' : 'not internal') . "\n"; // internal
11
+echo $reflection->getName()."\n"; // stdClass
12
+echo ($reflection->isInternal() === true ? 'internal' : 'not internal')."\n"; // internal
Please login to merge, or discard this patch.
demo/basic-reflection/example2.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
 use Roave\BetterReflection\BetterReflection;
6 6
 use Roave\BetterReflection\Reflection\ReflectionClass;
7 7
 
8
-require_once __DIR__ . '/../../vendor/autoload.php';
8
+require_once __DIR__.'/../../vendor/autoload.php';
9 9
 
10 10
 $reflection = (new BetterReflection())->classReflector()->reflect(ReflectionClass::class);
11 11
 
12
-echo $reflection->getName() . "\n"; // ReflectionClass
13
-echo ($reflection->isInternal() === true ? 'internal' : 'not internal') . "\n"; // not internal
12
+echo $reflection->getName()."\n"; // ReflectionClass
13
+echo ($reflection->isInternal() === true ? 'internal' : 'not internal')."\n"; // not internal
Please login to merge, or discard this patch.
src/Reflection/ReflectionClass.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 use PhpParser\Node\Stmt\ClassLike as ClassLikeNode;
12 12
 use PhpParser\Node\Stmt\ClassMethod;
13 13
 use PhpParser\Node\Stmt\Interface_ as InterfaceNode;
14
-use PhpParser\Node\Stmt\Namespace_ as NamespaceNode;
15 14
 use PhpParser\Node\Stmt\Namespace_;
16 15
 use PhpParser\Node\Stmt\Property as PropertyNode;
17 16
 use PhpParser\Node\Stmt\Trait_ as TraitNode;
Please login to merge, or discard this patch.
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public static function createFromInstance($instance) : self
130 130
     {
131
-        if (! is_object($instance)) {
131
+        if (!is_object($instance)) {
132 132
             throw new InvalidArgumentException('Instance must be an instance of an object');
133 133
         }
134 134
 
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function getShortName() : string
170 170
     {
171
-        if (! $this->isAnonymous()) {
171
+        if (!$this->isAnonymous()) {
172 172
             /** @var Node\Identifier $this->node->name */
173 173
             return $this->node->name->name;
174 174
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
      */
189 189
     public function getName() : string
190 190
     {
191
-        if (! $this->inNamespace()) {
191
+        if (!$this->inNamespace()) {
192 192
             return $this->getShortName();
193 193
         }
194 194
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     public function getNamespaceName() : string
205 205
     {
206
-        if (! $this->inNamespace()) {
206
+        if (!$this->inNamespace()) {
207 207
             return '';
208 208
         }
209 209
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         return array_merge(
237 237
             [],
238 238
             array_map(
239
-                function (ClassMethod $methodNode) : ReflectionMethod {
239
+                function(ClassMethod $methodNode) : ReflectionMethod {
240 240
                     return ReflectionMethod::createFromNode(
241 241
                         $this->reflector,
242 242
                         $methodNode,
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
                 $this->node->getMethods()
249 249
             ),
250 250
             ...array_map(
251
-                function (ReflectionClass $trait) : array {
252
-                    return array_map(function (ReflectionMethod $method) use ($trait) : ReflectionMethod {
251
+                function(ReflectionClass $trait) : array {
252
+                    return array_map(function(ReflectionMethod $method) use ($trait) : ReflectionMethod {
253 253
                         /** @var ClassMethod $methodAst */
254 254
                         $methodAst = $method->getAst();
255 255
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
                 $this->getTraits()
266 266
             ),
267 267
             ...array_map(
268
-                static function (ReflectionClass $ancestor) : array {
268
+                static function(ReflectionClass $ancestor) : array {
269 269
                     return $ancestor->getMethods();
270 270
                 },
271 271
                 array_values(array_merge(
@@ -346,8 +346,8 @@  discard block
 block discarded – undo
346 346
         return array_values(
347 347
             array_filter(
348 348
                 $this->getMethodsIndexedByName(),
349
-                static function (ReflectionMethod $method) use ($filter) : bool {
350
-                    return (bool) ($filter & $method->getModifiers());
349
+                static function(ReflectionMethod $method) use ($filter) : bool {
350
+                    return (bool)($filter & $method->getModifiers());
351 351
                 }
352 352
             )
353 353
         );
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     {
366 366
         /** @var ReflectionMethod[] $methods */
367 367
         $methods = array_map(
368
-            function (ClassMethod $methodNode) : ReflectionMethod {
368
+            function(ClassMethod $methodNode) : ReflectionMethod {
369 369
                 return ReflectionMethod::createFromNode(
370 370
                     $this->reflector,
371 371
                     $methodNode,
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         $methodsByName = [];
381 381
 
382 382
         foreach ($methods as $method) {
383
-            if ($filter !== null && ! ($filter & $method->getModifiers())) {
383
+            if ($filter !== null && !($filter & $method->getModifiers())) {
384 384
                 continue;
385 385
             }
386 386
 
@@ -399,8 +399,8 @@  discard block
 block discarded – undo
399 399
     {
400 400
         $methods = $this->getMethodsIndexedByName();
401 401
 
402
-        if (! isset($methods[$methodName])) {
403
-            throw new OutOfBoundsException('Could not find method: ' . $methodName);
402
+        if (!isset($methods[$methodName])) {
403
+            throw new OutOfBoundsException('Could not find method: '.$methodName);
404 404
         }
405 405
 
406 406
         return $methods[$methodName];
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
      */
428 428
     public function getImmediateConstants() : array
429 429
     {
430
-        return array_map(static function (ReflectionClassConstant $classConstant) {
430
+        return array_map(static function(ReflectionClassConstant $classConstant) {
431 431
             return $classConstant->getValue();
432 432
         }, $this->getImmediateReflectionConstants());
433 433
     }
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
      */
441 441
     public function getConstants() : array
442 442
     {
443
-        return array_map(static function (ReflectionClassConstant $classConstant) {
443
+        return array_map(static function(ReflectionClassConstant $classConstant) {
444 444
             return $classConstant->getValue();
445 445
         }, $this->getReflectionConstants());
446 446
     }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
     {
457 457
         $reflectionConstant = $this->getReflectionConstant($name);
458 458
 
459
-        if (! $reflectionConstant) {
459
+        if (!$reflectionConstant) {
460 460
             return null;
461 461
         }
462 462
 
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
         $constants = array_merge(
497 497
             [],
498 498
             ...array_map(
499
-                function (ConstNode $constNode) : array {
499
+                function(ConstNode $constNode) : array {
500 500
                     $constants = [];
501 501
 
502 502
                     foreach ($constNode->consts as $constantPositionInNode => $constantNode) {
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
                 },
508 508
                 array_filter(
509 509
                     $this->node->stmts,
510
-                    static function (Node\Stmt $stmt) : bool {
510
+                    static function(Node\Stmt $stmt) : bool {
511 511
                         return $stmt instanceof ConstNode;
512 512
                     }
513 513
                 )
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 
517 517
         return $this->cachedReflectionConstants = array_combine(
518 518
             array_map(
519
-                static function (ReflectionClassConstant $constant) : string {
519
+                static function(ReflectionClassConstant $constant) : string {
520 520
                     return $constant->getName();
521 521
                 },
522 522
                 $constants
@@ -539,18 +539,18 @@  discard block
 block discarded – undo
539 539
         $allReflectionConstants = array_merge(
540 540
             array_values($this->getImmediateReflectionConstants()),
541 541
             ...array_map(
542
-                static function (ReflectionClass $ancestor) : array {
542
+                static function(ReflectionClass $ancestor) : array {
543 543
                     return array_filter(
544 544
                         array_values($ancestor->getReflectionConstants()),
545
-                        static function (ReflectionClassConstant $classConstant) : bool {
546
-                            return ! $classConstant->isPrivate();
545
+                        static function(ReflectionClassConstant $classConstant) : bool {
546
+                            return !$classConstant->isPrivate();
547 547
                         }
548 548
                     );
549 549
                 },
550 550
                 array_filter([$this->getParentClass()])
551 551
             ),
552 552
             ...array_map(
553
-                static function (ReflectionClass $interface) : array {
553
+                static function(ReflectionClass $interface) : array {
554 554
                     return array_values($interface->getReflectionConstants());
555 555
                 },
556 556
                 array_values($this->getInterfaces())
@@ -579,11 +579,11 @@  discard block
 block discarded – undo
579 579
      */
580 580
     public function getConstructor() : ReflectionMethod
581 581
     {
582
-        $constructors = array_filter($this->getMethods(), static function (ReflectionMethod $method) : bool {
582
+        $constructors = array_filter($this->getMethods(), static function(ReflectionMethod $method) : bool {
583 583
             return $method->isConstructor();
584 584
         });
585 585
 
586
-        if (! isset($constructors[0])) {
586
+        if (!isset($constructors[0])) {
587 587
             throw new OutOfBoundsException('Could not find method: __construct');
588 588
         }
589 589
 
@@ -603,12 +603,12 @@  discard block
 block discarded – undo
603 603
         if ($this->cachedImmediateProperties === null) {
604 604
             $properties = [];
605 605
             foreach ($this->node->stmts as $stmt) {
606
-                if (! ($stmt instanceof PropertyNode)) {
606
+                if (!($stmt instanceof PropertyNode)) {
607 607
                     continue;
608 608
                 }
609 609
 
610 610
                 foreach ($stmt->props as $propertyPositionInNode => $propertyNode) {
611
-                    $prop                         = ReflectionProperty::createFromNode(
611
+                    $prop = ReflectionProperty::createFromNode(
612 612
                         $this->reflector,
613 613
                         $stmt,
614 614
                         $propertyPositionInNode,
@@ -629,8 +629,8 @@  discard block
 block discarded – undo
629 629
 
630 630
         return array_filter(
631 631
             $this->cachedImmediateProperties,
632
-            static function (ReflectionProperty $property) use ($filter) : bool {
633
-                return (bool) ($filter & $property->getModifiers());
632
+            static function(ReflectionProperty $property) use ($filter) : bool {
633
+                return (bool)($filter & $property->getModifiers());
634 634
             }
635 635
         );
636 636
     }
@@ -657,19 +657,19 @@  discard block
 block discarded – undo
657 657
                 array_merge(
658 658
                     [],
659 659
                     ...array_map(
660
-                        static function (ReflectionClass $ancestor) use ($filter) : array {
660
+                        static function(ReflectionClass $ancestor) use ($filter) : array {
661 661
                             return array_filter(
662 662
                                 $ancestor->getProperties($filter),
663
-                                static function (ReflectionProperty $property) : bool {
664
-                                    return ! $property->isPrivate();
663
+                                static function(ReflectionProperty $property) : bool {
664
+                                    return !$property->isPrivate();
665 665
                                 }
666 666
                             );
667 667
                         },
668 668
                         array_filter([$this->getParentClass()])
669 669
                     ),
670 670
                     ...array_map(
671
-                        function (ReflectionClass $trait) use ($filter) {
672
-                            return array_map(function (ReflectionProperty $property) use ($trait) : ReflectionProperty {
671
+                        function(ReflectionClass $trait) use ($filter) {
672
+                            return array_map(function(ReflectionProperty $property) use ($trait) : ReflectionProperty {
673 673
                                 return ReflectionProperty::createFromNode(
674 674
                                     $this->reflector,
675 675
                                     $property->getAst(),
@@ -693,8 +693,8 @@  discard block
 block discarded – undo
693 693
 
694 694
         return array_filter(
695 695
             $this->cachedProperties,
696
-            static function (ReflectionProperty $property) use ($filter) : bool {
697
-                return (bool) ($filter & $property->getModifiers());
696
+            static function(ReflectionProperty $property) use ($filter) : bool {
697
+                return (bool)($filter & $property->getModifiers());
698 698
             }
699 699
         );
700 700
     }
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
     {
709 709
         $properties = $this->getProperties();
710 710
 
711
-        if (! isset($properties[$name])) {
711
+        if (!isset($properties[$name])) {
712 712
             return null;
713 713
         }
714 714
 
@@ -729,10 +729,10 @@  discard block
 block discarded – undo
729 729
     public function getDefaultProperties() : array
730 730
     {
731 731
         return array_map(
732
-            static function (ReflectionProperty $property) {
732
+            static function(ReflectionProperty $property) {
733 733
                 return $property->getDefaultValue();
734 734
             },
735
-            array_filter($this->getProperties(), static function (ReflectionProperty $property) : bool {
735
+            array_filter($this->getProperties(), static function(ReflectionProperty $property) : bool {
736 736
                 return $property->isDefault();
737 737
             })
738 738
         );
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
      */
783 783
     public function getParentClass() : ?ReflectionClass
784 784
     {
785
-        if (! ($this->node instanceof ClassNode) || $this->node->extends === null) {
785
+        if (!($this->node instanceof ClassNode) || $this->node->extends === null) {
786 786
             return null;
787 787
         }
788 788
 
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
      */
805 805
     public function getParentClassNames() : array
806 806
     {
807
-        return array_map(static function (self $parentClass) : string {
807
+        return array_map(static function(self $parentClass) : string {
808 808
             return $parentClass->getName();
809 809
         }, array_slice(array_reverse($this->getInheritanceClassHierarchy()), 1));
810 810
     }
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
      */
834 834
     public function isUserDefined() : bool
835 835
     {
836
-        return ! $this->isInternal();
836
+        return !$this->isInternal();
837 837
     }
838 838
 
839 839
     /**
@@ -888,16 +888,16 @@  discard block
 block discarded – undo
888 888
     public function getTraits() : array
889 889
     {
890 890
         return array_map(
891
-            function (Node\Name $importedTrait) : ReflectionClass {
891
+            function(Node\Name $importedTrait) : ReflectionClass {
892 892
                 return $this->reflectClassForNamedNode($importedTrait);
893 893
             },
894 894
             array_merge(
895 895
                 [],
896 896
                 ...array_map(
897
-                    static function (TraitUse $traitUse) : array {
897
+                    static function(TraitUse $traitUse) : array {
898 898
                         return $traitUse->traits;
899 899
                     },
900
-                    array_filter($this->node->stmts, static function (Node $node) : bool {
900
+                    array_filter($this->node->stmts, static function(Node $node) : bool {
901 901
                         return $node instanceof TraitUse;
902 902
                     })
903 903
                 )
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
     public function getTraitNames() : array
933 933
     {
934 934
         return array_map(
935
-            static function (ReflectionClass $trait) : string {
935
+            static function(ReflectionClass $trait) : string {
936 936
                 return $trait->getName();
937 937
             },
938 938
             $this->getTraits()
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
     public function getTraitAliases() : array
962 962
     {
963 963
         /** @var Node\Stmt\TraitUse[] $traitUsages */
964
-        $traitUsages = array_filter($this->node->stmts, static function (Node $node) : bool {
964
+        $traitUsages = array_filter($this->node->stmts, static function(Node $node) : bool {
965 965
             return $node instanceof TraitUse;
966 966
         });
967 967
 
@@ -978,11 +978,11 @@  discard block
 block discarded – undo
978 978
                     $usedTrait = $traitNames[0];
979 979
                 }
980 980
 
981
-                if (! ($adaptation instanceof Node\Stmt\TraitUseAdaptation\Alias)) {
981
+                if (!($adaptation instanceof Node\Stmt\TraitUseAdaptation\Alias)) {
982 982
                     continue;
983 983
                 }
984 984
 
985
-                if (! $adaptation->newName) {
985
+                if (!$adaptation->newName) {
986 986
                     continue;
987 987
                 }
988 988
 
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
     public function getInterfaces() : array
1009 1009
     {
1010 1010
         return array_merge(...array_map(
1011
-            static function (self $reflectionClass) : array {
1011
+            static function(self $reflectionClass) : array {
1012 1012
                 return $reflectionClass->getCurrentClassImplementedInterfacesIndexedByName();
1013 1013
             },
1014 1014
             $this->getInheritanceClassHierarchy()
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
     public function getInterfaceNames() : array
1037 1037
     {
1038 1038
         return array_values(array_map(
1039
-            static function (self $interface) : string {
1039
+            static function(self $interface) : string {
1040 1040
                 return $interface->getName();
1041 1041
             },
1042 1042
             $this->getInterfaces()
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
      */
1057 1057
     public function isInstance($object) : bool
1058 1058
     {
1059
-        if (! is_object($object)) {
1059
+        if (!is_object($object)) {
1060 1060
             throw NotAnObject::fromNonObject($object);
1061 1061
         }
1062 1062
 
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
         return in_array(
1078 1078
             ltrim($className, '\\'),
1079 1079
             array_map(
1080
-                static function (self $reflectionClass) : string {
1080
+                static function(self $reflectionClass) : string {
1081 1081
                     return $reflectionClass->getName();
1082 1082
                 },
1083 1083
                 array_slice(array_reverse($this->getInheritanceClassHierarchy()), 1)
@@ -1131,11 +1131,11 @@  discard block
 block discarded – undo
1131 1131
      */
1132 1132
     public function isCloneable() : bool
1133 1133
     {
1134
-        if (! $this->isInstantiable()) {
1134
+        if (!$this->isInstantiable()) {
1135 1135
             return false;
1136 1136
         }
1137 1137
 
1138
-        if (! $this->hasMethod('__clone')) {
1138
+        if (!$this->hasMethod('__clone')) {
1139 1139
             return true;
1140 1140
         }
1141 1141
 
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
             return array_merge(
1164 1164
                 [],
1165 1165
                 ...array_map(
1166
-                    function (Node\Name $interfaceName) : array {
1166
+                    function(Node\Name $interfaceName) : array {
1167 1167
                         return $this
1168 1168
                             ->reflectClassForNamedNode($interfaceName)
1169 1169
                             ->getInterfacesHierarchy();
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
      */
1201 1201
     private function getInterfacesHierarchy() : array
1202 1202
     {
1203
-        if (! $this->isInterface()) {
1203
+        if (!$this->isInterface()) {
1204 1204
             throw NotAnInterfaceReflection::fromReflectionClass($this);
1205 1205
         }
1206 1206
 
@@ -1210,7 +1210,7 @@  discard block
 block discarded – undo
1210 1210
         return array_merge(
1211 1211
             [$this->getName() => $this],
1212 1212
             ...array_map(
1213
-                function (Node\Name $interfaceName) : array {
1213
+                function(Node\Name $interfaceName) : array {
1214 1214
                     return $this
1215 1215
                         ->reflectClassForNamedNode($interfaceName)
1216 1216
                         ->getInterfacesHierarchy();
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
     {
1245 1245
         $property = $this->getProperty($propertyName);
1246 1246
 
1247
-        if (! $property || ! $property->isStatic()) {
1247
+        if (!$property || !$property->isStatic()) {
1248 1248
             throw PropertyDoesNotExist::fromName($propertyName);
1249 1249
         }
1250 1250
 
@@ -1265,7 +1265,7 @@  discard block
 block discarded – undo
1265 1265
     {
1266 1266
         $property = $this->getProperty($propertyName);
1267 1267
 
1268
-        if (! $property || ! $property->isStatic()) {
1268
+        if (!$property || !$property->isStatic()) {
1269 1269
             throw PropertyDoesNotExist::fromName($propertyName);
1270 1270
         }
1271 1271
 
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
         $staticProperties = [];
1281 1281
 
1282 1282
         foreach ($this->getProperties() as $property) {
1283
-            if (! $property->isStatic()) {
1283
+            if (!$property->isStatic()) {
1284 1284
                 continue;
1285 1285
             }
1286 1286
 
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
      */
1311 1311
     public function setFinal(bool $isFinal) : void
1312 1312
     {
1313
-        if (! $this->node instanceof ClassNode) {
1313
+        if (!$this->node instanceof ClassNode) {
1314 1314
             throw NotAClassReflection::fromReflectionClass($this);
1315 1315
         }
1316 1316
 
@@ -1389,11 +1389,11 @@  discard block
 block discarded – undo
1389 1389
         $lowerName = strtolower($propertyName);
1390 1390
 
1391 1391
         foreach ($this->node->stmts as $key => $stmt) {
1392
-            if (! ($stmt instanceof PropertyNode)) {
1392
+            if (!($stmt instanceof PropertyNode)) {
1393 1393
                 continue;
1394 1394
             }
1395 1395
 
1396
-            $propertyNames = array_map(static function (Node\Stmt\PropertyProperty $propertyProperty) : string {
1396
+            $propertyNames = array_map(static function(Node\Stmt\PropertyProperty $propertyProperty) : string {
1397 1397
                 return $propertyProperty->name->toLowerString();
1398 1398
             }, $stmt->props);
1399 1399
 
Please login to merge, or discard this patch.
src/Reflection/Adapter/ReflectionMethod.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 
6 6
 use ReflectionException as CoreReflectionException;
7 7
 use ReflectionMethod as CoreReflectionMethod;
8
-use Roave\BetterReflection\Reflection\Exception\NoObjectProvided;
9 8
 use Roave\BetterReflection\Reflection\Exception\NotAnObject;
10 9
 use Roave\BetterReflection\Reflection\ReflectionMethod as BetterReflectionMethod;
11 10
 use Throwable;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
      */
331 331
     public function invoke($object = null, $args = null)
332 332
     {
333
-        if (! $this->isAccessible()) {
333
+        if (!$this->isAccessible()) {
334 334
             throw new CoreReflectionException('Method not accessible');
335 335
         }
336 336
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
      */
349 349
     public function invokeArgs($object = null, array $args = [])
350 350
     {
351
-        if (! $this->isAccessible()) {
351
+        if (!$this->isAccessible()) {
352 352
             throw new CoreReflectionException('Method not accessible');
353 353
         }
354 354
 
Please login to merge, or discard this patch.