-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Skip parent::class usage on GetClassToInstanceOfRector (#…
- Loading branch information
1 parent
7a37df2
commit 3b40197
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...CodeQuality/Rector/Identical/GetClassToInstanceOfRector/Fixture/skip_parent_usage.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Identical\GetClassToInstanceOfRector\Fixture; | ||
|
||
class SkipParentUsage extends SomeParent { | ||
public function test(object $other) { | ||
var_dump(parent::class); | ||
var_dump(get_class($other) === parent::class); | ||
var_dump($other instanceof parent); | ||
} | ||
} | ||
|
||
(new SkipParentUsage())->test(new SkipParentUsage()); |
7 changes: 7 additions & 0 deletions
7
rules-tests/CodeQuality/Rector/Identical/GetClassToInstanceOfRector/Source/SomeParent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Identical\GetClassToInstanceOfRector\Source; | ||
|
||
class SomeParent | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters