We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SlevomatCodingStandard.PHP.UselessParentheses
$var = (new ClassName());
Essentially what I wrote in the title.
I added the SlevomatCodingStandard.PHP.UselessParentheses sniff to try to pick up on these useless parentheses from a recent code review:
$remoteAddress = (new RemoteAddress());
but it never detected it. It did detect a lot of other useless parentheses, though :)
Of course, if I did something like this:
$ip = (new RemoteAddress())->getIpAddress();
I expect the sniff not to report as useless (but PHP 8.4 might allow no parentheses around new objects!?)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Essentially what I wrote in the title.
I added the
SlevomatCodingStandard.PHP.UselessParentheses
sniff to try to pick up on these useless parentheses from a recent code review:but it never detected it. It did detect a lot of other useless parentheses, though :)
Of course, if I did something like this:
I expect the sniff not to report as useless (but PHP 8.4 might allow no parentheses around new objects!?)
The text was updated successfully, but these errors were encountered: