镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[DeadCode] Handle multiple default on RemoveArgumentFromDefaultParentCallRector - #6978

Merged
samsonasik merged 4 commits into
mainfrom
multiple-de
Jun 11, 2025
Merged

samsonasik merged 4 commits into
mainfrom
multiple-de

Conversation

@samsonasik

@samsonasik samsonasik commented Jun 11, 2025 •

Copy link
Copy Markdown
Member

On this code:

final class MultipleDefault extends Exception
{
    public function __construct(string $message)
    {
        parent::__construct($message, 0, null);
    }
}

0 and null are default parameters, so both needs to be removed.

-        parent::__construct($message, 0, null);
+        parent::__construct($message);

@samsonasik

samsonasik commented Jun 11, 2025 •

Copy link
Copy Markdown
Member Author

The issue is on ValueResolver itself, which convert null to string "null"

if ($expr instanceof ConstFetch) {
return $this->nodeNameResolver->getName($expr);
}

as it returns name on ConstFetch

@samsonasik

samsonasik commented Jun 11, 2025 •

Copy link
Copy Markdown
Member Author

Fixed by show returns value on null, true, and false on ValueResolver 4276016

@samsonasik

Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant