-
-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test fixture on boolean && in RemoveAlwaysTrueIfConditionRector (#…
…5749) * add fixture on boolean and * Add boolean and if support to RemoveAlwaysTrueIfConditionRector * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
da67bb9
commit 98a2a6f
Showing
2 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...s-tests/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector/Fixture/boolean_and.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,35 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector\Fixture; | ||
|
||
final class BooleanAndWithObject | ||
{ | ||
public function run(\stdClass $someObject) | ||
{ | ||
if (is_object($someObject) && method_exists($someObject, 'some_method')) { | ||
return 100; | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector\Fixture; | ||
|
||
final class BooleanAndWithObject | ||
{ | ||
public function run(\stdClass $someObject) | ||
{ | ||
if (method_exists($someObject, 'some_method')) { | ||
return 100; | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
|
||
?> |
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