-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix StrContainsRector when strpos offset is set (#3086)
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
- Loading branch information
1 parent
eddc376
commit 30afbb8
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
rules-tests/Php80/Rector/NotIdentical/StrContainsRector/Fixture/offset_strpos.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,25 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\NotIdentical\StrContainsRector\Fixture; | ||
|
||
class OffsetStrpos | ||
{ | ||
public function run() | ||
{ | ||
return strpos('abc', 'a', 1) !== false; | ||
} | ||
} | ||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\NotIdentical\StrContainsRector\Fixture; | ||
|
||
class OffsetStrpos | ||
{ | ||
public function run() | ||
{ | ||
return str_contains(substr('abc', 1), 'a'); | ||
} | ||
} | ||
?> |
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