-
-
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.
[CodeQuality] Add Function_ and FuncCall support on OptionalParameter…
…sAfterRequiredRector (#5835) * [CodeQuality] Add Function_ and FuncCall support on OptionalParametersAfterRequiredRector * rename method * clean up * cs fix * [ci-review] Rector Rectify * fix phpstan * test skip after 2nd try * skip native func call --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
b81ef2f
commit 1374e15
Showing
6 changed files
with
123 additions
and
46 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...lity/Rector/ClassMethod/OptionalParametersAfterRequiredRector/Fixture/on_function.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,23 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector\Fixture; | ||
|
||
function foo($optional = 1, $required) | ||
{ | ||
} | ||
|
||
foo($optional, $required); | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector\Fixture; | ||
|
||
function foo($required, $optional = 1) | ||
{ | ||
} | ||
|
||
foo($required, $optional); | ||
|
||
?> |
9 changes: 9 additions & 0 deletions
9
...ptionalParametersAfterRequiredRector/Fixture/skip_correct_optional_after_required.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,9 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector\Fixture; | ||
|
||
function skip_correct_optional_after_required($required, $optional = 1) | ||
{ | ||
} | ||
|
||
skip_correct_optional_after_required($required, $optional); |
5 changes: 5 additions & 0 deletions
5
...r/ClassMethod/OptionalParametersAfterRequiredRector/Fixture/skip_native_func_call.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,5 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector\Fixture; | ||
|
||
implode(['foo'], ''); |
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