-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php74] Skip parenthesize ternary if on ParenthesizeNestedTernaryRect…
…or (#3980) * [Php74] Skip parenthesize ternary if on ParenthesizeNestedTernaryRector * more fixture * fixture syntax * [ci-review] Rector Rectify * Fixed 🎉 * increase kernel cache key * fix --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
2f84187
commit 385a9cb
Showing
5 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...or/Ternary/ParenthesizeNestedTernaryRector/Fixture/skip_parenthesize_ternary_else.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,11 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\Ternary\ParenthesizeNestedTernaryRector\Fixture; | ||
|
||
function skipParenthesizeTernaryElse(string $message): string | ||
{ | ||
$jsonParser = new JsonParser(); | ||
return ! $jsonParser->lint($message) instanceof ParsingException | ||
? 'application/problem+json' | ||
: (strip_tags($message) === $message ? 'text/plain' : 'text/html'); | ||
} |
11 changes: 11 additions & 0 deletions
11
...ctor/Ternary/ParenthesizeNestedTernaryRector/Fixture/skip_parenthesize_ternary_if.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,11 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php74\Rector\Ternary\ParenthesizeNestedTernaryRector\Fixture; | ||
|
||
function skipParenthesizeTernaryIf(string $message): string | ||
{ | ||
$jsonParser = new JsonParser(); | ||
return $jsonParser->lint($message) instanceof ParsingException | ||
? (strip_tags($message) === $message ? 'text/plain' : 'text/html') | ||
: 'application/problem+json'; | ||
} |
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
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
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