-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Arguments] Handle by pass 2nd argument default value on ArgumentAdde…
…rRector (#1946) * [Arguments] Handle by pass 2nd argument on ArgumentAdderRector * [Arguments] Handle by pass 2nd argument on ArgumentAdderRector * Fixed 🎉
- Loading branch information
1 parent
dd842d6
commit 2d3419b
Showing
4 changed files
with
99 additions
and
8 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...ts/Arguments/Rector/ClassMethod/ArgumentAdderRector/Fixture/by_pass_2nd_arg_value.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,33 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Arguments\Rector\ClassMethod\ArgumentAdderRector\Fixture; | ||
|
||
use Rector\Tests\Arguments\Rector\ClassMethod\ArgumentAdderRector\Source\SomeMultiArg; | ||
|
||
class ByPass2ndArgValue | ||
{ | ||
public function run() | ||
{ | ||
$containerBuilder = new SomeMultiArg(); | ||
$containerBuilder->run(1); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Arguments\Rector\ClassMethod\ArgumentAdderRector\Fixture; | ||
|
||
use Rector\Tests\Arguments\Rector\ClassMethod\ArgumentAdderRector\Source\SomeMultiArg; | ||
|
||
class ByPass2ndArgValue | ||
{ | ||
public function run() | ||
{ | ||
$containerBuilder = new SomeMultiArg(); | ||
$containerBuilder->run(1, 2, 4); | ||
} | ||
} | ||
|
||
?> |
12 changes: 12 additions & 0 deletions
12
rules-tests/Arguments/Rector/ClassMethod/ArgumentAdderRector/Source/SomeMultiArg.php
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 | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Arguments\Rector\ClassMethod\ArgumentAdderRector\Source; | ||
|
||
class SomeMultiArg | ||
{ | ||
public function run($a = 1, $b = 2, $c = 3) | ||
{ | ||
} | ||
} |
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