Closed jwittorf closed 11 months ago
@jwittorf Thank you for reporting this. I've been able to reproduce the issues and am working on a fix.
Okay, done. PR #3791 should fix this. Testing appreciated.
Thanks for your quick response and fix @jrfnl! I've tested it in my setup, looks good :)
But the checks for PHP 8.2 still fail?
Thanks for your quick response and fix @jrfnl! I've tested it in my setup, looks good :)
But the checks for PHP 8.2 still fail?
Thanks for testing, Re: the PHP 8.2 test run, that is unrelated to this issue. See #3731
But the checks for PHP 8.2 still fail?
Thanks for testing, Re: the PHP 8.2 test run, that is unrelated to this issue. See #3731
This specific failure seems to be what is being fixed in https://github.com/squizlabs/PHP_CodeSniffer/pull/3773, not related to #3731.
@fredden As I pointed out before, they are related. Also: different discussion, not in this issue.
@jrfnl it looks like #3791 only addresses one of the four bullet points raised in this issue. Did you determine that the other three are false-alerts / side effects?
- The
new
keyword gets additional()
braces- The interface-names don't get indented and lined up correctly
- The opening
{
for the class gets removed- The methods get wrong
From what I can tell:
@jrfnl it looks like #3791 only addresses one of the four bullet points raised in this issue. Did you determine that the other three are false-alerts / side effects?
Yes, I did, see my comment in the PR. They are all side-effects. There is nothing else to do.
Sorry @jrfnl, I've now seen the note on the pull request which specifically addresses my query.
FYI: the fix for this issue is included in today's PHP_CodeSniffer 3.8.0 release.
As per #3932, development on PHP_CodeSniffer will continue in the PHPCSStandards/PHP_CodeSniffer repository. If you want to stay informed, you may want to start "watching" that repo (or watching releases from that repo).
Describe the bug In some cases anonymous classes with
extends
andimplements
cause aParseError
after "fixing" the file.It happens if there is no space between the last interface-name and the
{
, see following code samples.The following happens, see code samples at the end:
new
keyword gets additional()
braces{
for the class gets removedCode sample
Custom ruleset
To reproduce Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior I would expect the correct formatting like the code below with following "steps":
{
into an own line, no indention()
after thenew
keywordVersions: