Closed BigBadBassMan closed 2 years ago
@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! Cannot wait to see this merged and released!
@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 ...
FOUND 1 ERROR AFFECTING 1 LINE
line | ERROR | [x] Parentheses must be used when instantiating a new class | | (PSR12.Classes.ClassInstantiation.MissingParentheses)