-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
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
PSR12.Classes.ClassInstantiation.MissingParentheses false positive when instantiating parent classes #3668
Comments
@BigBadBassMan Thanks for reporting this! I can confirm this is a regression introduced in PHPCS 3.7.0. PR #3669 should fix this. Testing appreciated. |
@jrfnl Thanks for the extremely speedy fix, confirmed to work! |
@BigBadBassMan Thanks for testing and confirming the fix! |
Thanks a lot @jrfnl for fixing this and similar issues in 2 other sniffs. Thanks for the bug report @BigBadBassMan. |
@gsherwood Thanks for the update. Not sure if there is any reason behind this but the updated tag is not available on Packagist yet. Can you push the tag there as well so that it can be installed via composer easily? |
@gautamverma40 PHPCS 3.7.2 hasn't been released yet... |
Describe the bug
When instantiating a parent class using the keyword "parent", PHPCS flags this as wrong and PHPCBF inserts brackets after the
new
thus breaking code.Code sample
see also: https://3v4l.org/5WDl4
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
No error report and no changed code from PHPCBF.
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: