-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SingleInArrayToCompareRector if array item is variadic (#3640)
* Add failing test fixture for SingleInArrayToCompareRector Based on https://getrector.com/demo/001ae62c-7857-4ce2-b4c1-8be77fd37568 * fix SingleInArrayToCompareRector in case the array item is variadic * rename SingleInArrayToCompareRector unpacking fixture as suggested by @samsonasik
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...ector/FuncCall/SingleInArrayToCompareRector/Fixture/skip_unpack_array_item_exists.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,12 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\FuncCall\SingleInArrayToCompareRector\Fixture; | ||
|
||
final class SkipUnpackArrayItemExists | ||
{ | ||
public function run() | ||
{ | ||
$a = ['a', 'b']; | ||
echo in_array('a', [...$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