-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php81] Skip Encapsed on NullToStrictStringFuncCallArgRector (#2744)
* Add failing test fixture for NullToStrictStringFuncCallArgRector # Failing Test for NullToStrictStringFuncCallArgRector Based on https://getrector.org/demo/b778fb29-98e6-4992-b4fa-b14a0be26429 In this case, the first argument of the mb_strlen function cannot be something else than a string, so the cast to string is useless * Closes #2742 Co-authored-by: Grégoire Pineau <lyrixx@lyrixx.info>
- Loading branch information
1 parent
93b63b0
commit d7be258
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...s/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/skip_encapsed.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,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector\Fixture; | ||
|
||
final class SkipEncapsed | ||
{ | ||
public function foo(string $bar): array | ||
{ | ||
mb_strlen("foo:{$bar}:"); | ||
} | ||
} | ||
|
||
?> |
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