mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-25 04:12:36 +00:00
[PHP 8.0] skip alternative arg count (#5283)
This commit is contained in:
parent
7db7d4e037
commit
9cd09e9512
|
@ -130,6 +130,10 @@ CODE_SAMPLE
|
|||
return null;
|
||||
}
|
||||
|
||||
if (count($new->args) !== count($constructorClassMethod->getParams())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$newArgs = $this->argumentSorter->sortArgsByExpectedParamOrder($new->args, $expectedOrderedParams);
|
||||
if ($new->args === $newArgs) {
|
||||
return null;
|
||||
|
@ -157,6 +161,10 @@ CODE_SAMPLE
|
|||
return null;
|
||||
}
|
||||
|
||||
if (count($methodCall->args) !== count($classMethod->getParams())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$newArgs = $this->argumentSorter->sortArgsByExpectedParamOrder($methodCall->args, $expectedOrderedParams);
|
||||
if ($methodCall->args === $newArgs) {
|
||||
return null;
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Php80\Tests\Rector\ClassMethod\OptionalParametersAfterRequiredRector\Fixture;
|
||||
|
||||
final class SkipFuncGetArgs
|
||||
{
|
||||
public function go($required)
|
||||
{
|
||||
$args = func_get_args();
|
||||
return $args;
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return $this->go(1, 5, 100);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user