-
-
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.
[Php73] Handle named argument on JsonThrowOnErrorRector (#1021)
* Test case for Incorrect behavior of JsonThrowOnErrorRector #6752 * Closes #1020 Fixes rectorphp/rector#6752 * allow named on json or value key * not allowed named argument * clean up * clean up Co-authored-by: Björn Bösel <bjoernboesel@gmail.com>
- Loading branch information
1 parent
33e5cab
commit 34b254a
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...ts/Php73/Rector/FuncCall/JsonThrowOnErrorRector/Fixture/skip_named_argument_flags.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,8 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php73\Rector\FuncCall\JsonThrowOnErrorRector\Fixture; | ||
|
||
function skipNamedArgumentFlags($str){ | ||
json_decode($str, flags: JSON_THROW_ON_ERROR); | ||
} | ||
|
8 changes: 8 additions & 0 deletions
8
.../Rector/FuncCall/JsonThrowOnErrorRector/Fixture/skip_named_argument_value_or_json.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,8 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php73\Rector\FuncCall\JsonThrowOnErrorRector\Fixture; | ||
|
||
function skipNamedArgumentValueOrJson($str, array $data){ | ||
json_decode(json: $str); | ||
json_encode(value: $data); | ||
} |
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