-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHP81] Skip after is_string on object call on NullToStrictStringFunc…
…CallArgRector (#5572) * [PHP81] Skip after is_string on object call on NullToStrictStringFuncCallArgRector * fix
- Loading branch information
1 parent
a76ec29
commit af4d3db
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...l/NullToStrictStringFuncCallArgRector/Fixture/skip_after_is_string_on_object_call.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,14 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector\Fixture; | ||
|
||
final class SkipAfterIsStringOnObjectCall | ||
{ | ||
public ?string $stringNull = 'foo'; | ||
} | ||
|
||
$demo = new SkipAfterIsStringOnObjectCall(); | ||
|
||
if (is_string($demo->stringNull) && trim($demo->stringNull) !== '') { | ||
echo $demo->stringNull; | ||
} |
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