-
-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodingStyle] Add variadic method call unpack to CallUserFuncCallToVa…
…riadicRector (#6316)
- Loading branch information
1 parent
d689800
commit 2e6d188
Showing
6 changed files
with
165 additions
and
8 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...Style/Rector/FuncCall/CallUserFuncCallToVariadicRector/Fixture/array_local_method.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,47 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Source\Redirector; | ||
|
||
final class ArrayLocalMethod | ||
{ | ||
private $redirector; | ||
|
||
public function __construct() | ||
{ | ||
$this->redirector = new Redirector(); | ||
} | ||
|
||
public function run() | ||
{ | ||
$args = \func_get_args(); | ||
call_user_func_array([$this->redirector, 'redirect'], $args); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Source\Redirector; | ||
|
||
final class ArrayLocalMethod | ||
{ | ||
private $redirector; | ||
|
||
public function __construct() | ||
{ | ||
$this->redirector = new Redirector(); | ||
} | ||
|
||
public function run() | ||
{ | ||
$args = \func_get_args(); | ||
$this->redirector->redirect(...$args); | ||
} | ||
} | ||
|
||
?> |
47 changes: 47 additions & 0 deletions
47
...ncCall/CallUserFuncCallToVariadicRector/Fixture/array_local_method_with_reference.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,47 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Source\Redirector; | ||
|
||
final class ArrayLocalMethodWithReference | ||
{ | ||
private $redirector; | ||
|
||
public function __construct() | ||
{ | ||
$this->redirector = new Redirector(); | ||
} | ||
|
||
public function run() | ||
{ | ||
$args = \func_get_args(); | ||
call_user_func_array([&$this->redirector, 'redirect'], $args); | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Fixture; | ||
|
||
use Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Source\Redirector; | ||
|
||
final class ArrayLocalMethodWithReference | ||
{ | ||
private $redirector; | ||
|
||
public function __construct() | ||
{ | ||
$this->redirector = new Redirector(); | ||
} | ||
|
||
public function run() | ||
{ | ||
$args = \func_get_args(); | ||
$this->redirector->redirect(...$args); | ||
} | ||
} | ||
|
||
?> |
12 changes: 12 additions & 0 deletions
12
...-tests/CodingStyle/Rector/FuncCall/CallUserFuncCallToVariadicRector/Source/Redirector.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\CodingStyle\Rector\FuncCall\CallUserFuncCallToVariadicRector\Source; | ||
|
||
final class Redirector | ||
{ | ||
public function redirect($first, $second) | ||
{ | ||
} | ||
} |
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