-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodingStyle] Handle crash on pass args on CallUserFuncToMethodCallRe…
…ctor (#6598)
- Loading branch information
1 parent
654d5a2
commit 0efbe13
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...tests/CodingStyle/Rector/FuncCall/CallUserFuncToMethodCallRector/Fixture/pass_arg.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,35 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector\Fixture; | ||
|
||
abstract class PassArg | ||
{ | ||
public array $args; | ||
|
||
public function __construct(array $args = []) | ||
{ | ||
if ($args !== [] && method_exists($this, 'args')) { | ||
$this->args = call_user_func([$this, 'args'], $args); | ||
} | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodingStyle\Rector\FuncCall\CallUserFuncToMethodCallRector\Fixture; | ||
|
||
abstract class PassArg | ||
{ | ||
public array $args; | ||
|
||
public function __construct(array $args = []) | ||
{ | ||
if ($args !== [] && method_exists($this, 'args')) { | ||
$this->args = $this->args($args); | ||
} | ||
} | ||
} | ||
|
||
?> |
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