-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeadCode] Skip $this instanceof in Trait on RemoveAlwaysTrueIfCondit…
…ionRector (#5817) * [DeadCode] Skip $this instanceof in Trait on RemoveAlwaysTrueIfConditionRector * rename trait name
- Loading branch information
1 parent
879a36b
commit 7d69fc2
Showing
2 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...sts/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector/Fixture/skip_trait_this.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,17 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector\Fixture; | ||
|
||
use DateTimeInterface; | ||
|
||
trait SkipTraitThis | ||
{ | ||
public function getIssue(): void | ||
{ | ||
foreach (['value_1', 'value_2'] as $value) { | ||
if ($this instanceof DateTimeInterface && $this->getExample() === false) { | ||
$this->setExample('demo'); | ||
} | ||
} | ||
} | ||
} |
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