File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture
rules/CodeQuality/NodeFactory Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ declare(strict_types=1);
55namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \WithCallbackIdenticalToStandaloneAssertsRector \Fixture ;
66
77use PHPUnit \Framework \TestCase ;
8- use Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \WithCallbackIdenticalToStandaloneAssertsRector \Source \SomeClassWithMethodCall ;
98
109final class OnSelf extends TestCase
1110{
@@ -19,4 +18,30 @@ final class OnSelf extends TestCase
1918 }
2019}
2120
21+ ?>
22+ -----
23+ <?php
24+
25+ declare (strict_types=1 );
26+
27+ namespace Rector \PHPUnit \Tests \CodeQuality \Rector \MethodCall \WithCallbackIdenticalToStandaloneAssertsRector \Fixture ;
28+
29+ use PHPUnit \Framework \TestCase ;
30+
31+ final class OnSelf extends TestCase
32+ {
33+ public function test ()
34+ {
35+ $ someMock = $ this ->getMockBuilder ('AnyType ' )->getMock ();
36+
37+ $ someMock ->expects ($ this ->any ())
38+ ->method ('trans ' )
39+ ->with ($ this ->callback (function ($ arg ): bool {
40+ $ this ->assertInstanceOf (self ::class, $ arg );
41+ $ this ->assertTrue ($ arg ->isReady ());
42+ return true ;
43+ }));
44+ }
45+ }
46+
2247?>
Original file line number Diff line number Diff line change @@ -78,8 +78,10 @@ public function create(array $exprs): array
7878 }
7979
8080 if ($ expr instanceof Instanceof_) {
81- if ($ expr ->class instanceof Name ) {
81+ if ($ expr ->class instanceof FullyQualified ) {
8282 $ classNameExpr = new ClassConstFetch (new FullyQualified ($ expr ->class ->name ), 'class ' );
83+ } elseif ($ expr ->class instanceof Name) {
84+ $ classNameExpr = new ClassConstFetch (new Name ($ expr ->class ->name ), 'class ' );
8385 } else {
8486 $ classNameExpr = $ expr ->class ;
8587 }
You can’t perform that action at this time.
0 commit comments