Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Add support for compare $this::class compare with strin…
…g on UseIdenticalOverEqualWithSameTypeRector (#5698)
- Loading branch information
1 parent
4a1880b
commit 6225460
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...deQuality/Rector/Equal/UseIdenticalOverEqualWithSameTypeRector/Fixture/this_class.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,37 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector\Fixture; | ||
|
||
abstract class ThisClass | ||
{ | ||
public function run() | ||
{ | ||
return $this::class == 'SomeClass'; | ||
} | ||
|
||
public function run2() | ||
{ | ||
return 'SomeClass' == $this::class; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector\Fixture; | ||
|
||
abstract class ThisClass | ||
{ | ||
public function run() | ||
{ | ||
return $this::class === 'SomeClass'; | ||
} | ||
|
||
public function run2() | ||
{ | ||
return 'SomeClass' === $this::class; | ||
} | ||
} | ||
|
||
?> |
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