[CodeQuality] Skip fluent call from FuncCall crash on OptionalParametersAfterRequiredRector#4533
[CodeQuality] Skip fluent call from FuncCall crash on OptionalParametersAfterRequiredRector#4533samsonasik wants to merge 8 commits intomainfrom
Conversation
|
@Kauto this should fix rectorphp/rector#8063, I tried in getrector.org server :) |
|
@TomasVotruba the following use case need to be covered 8009b39 final class UpdateMethodCallByFluent
{
public function run($optional = 1, $required)
{
return $this;
}
public function execute()
{
}
public function process()
{
$this->run(1, 5)
->execute();
}
}The original functionality actually not working yet for above case even the hack reverted. |
|
@TomasVotruba it seems actually working on proper fluent call return 👍 |
|
The buggy part will be on second part as fluent: final class UpdateMethodCallByFluent2
{
public function execute()
{
return $this;
}
public function run($optional = 1, $required)
{
return $this;
}
public function process()
{
$this->execute()
->run(1, 5);
}
} |
|
Really unsure how to cover this, some process probably overlapped when tested in server https://getrector.com/demo/576513b9-85eb-48d8-88db-1e3507857c19 @TomasVotruba probably the best way is to extends PHPStan printer ? |
It might need some cache clearing, e.g. |
|
@TomasVotruba I tried that, not working, the issue is happen only on fluent call:
|
|
Closing as resolved at PR: |
Fixes rectorphp/rector#8063
Ref https://getrector.com/demo/576513b9-85eb-48d8-88db-1e3507857c19