-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #5045 BacktickToShellExecFixer - add priority relation to NativeF…
…unctionInvocationFixer and SingleQuoteFixer (kubawerlos) This PR was merged into the 2.15 branch. Discussion ---------- BacktickToShellExecFixer - add priority relation to NativeFunctionInvocationFixer and SingleQuoteFixer This is actually a bug fix, because at `2.16` `NativeFunctionInvocationFixer` has priority [10](https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v2.16.4/src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php#L171), which is greater that `BacktickToShellExecFixer` priority ([2](https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v2.16.4/src/Fixer/Alias/BacktickToShellExecFixer.php#L63)). So, for the person who will be merging this up to `2.16`: on the conflict in `NativeFunctionInvocationFixer` for priorities `10` and `1` - choose `1` or tests would fail. Commits ------- 7e5ffd7 BacktickToShellExecFixer - add priority relation to NativeFunctionInvocationFixer and SingleQuoteFixer
- Loading branch information
Showing
7 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ public function isRisky() | |
*/ | ||
public function getPriority() | ||
{ | ||
return 1; | ||
return 2; | ||
} | ||
|
||
/** | ||
|
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
11 changes: 11 additions & 0 deletions
11
tests/Fixtures/Integration/priority/backtick_to_shell_exec,native_function_invocation.test
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 @@ | ||
--TEST-- | ||
Integration of fixers: backtick_to_shell_exec,native_function_invocation. | ||
--RULESET-- | ||
{"backtick_to_shell_exec": true, "native_function_invocation": true} | ||
--EXPECT-- | ||
<?php | ||
$var = \shell_exec("pwd"); | ||
|
||
--INPUT-- | ||
<?php | ||
$var = `pwd`; |
11 changes: 11 additions & 0 deletions
11
tests/Fixtures/Integration/priority/backtick_to_shell_exec,single_quote.test
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 @@ | ||
--TEST-- | ||
Integration of fixers: backtick_to_shell_exec,single_quote. | ||
--RULESET-- | ||
{"backtick_to_shell_exec": true, "single_quote": true} | ||
--EXPECT-- | ||
<?php | ||
$var = shell_exec('pwd'); | ||
|
||
--INPUT-- | ||
<?php | ||
$var = `pwd`; |