Skip to content

Conversation

@dcolt
Copy link
Collaborator

@dcolt dcolt commented Dec 17, 2025

If a function is having multiple rows in the parameters, then nothing can be on the first row.

POC for #18

@dcolt dcolt requested review from bix0r and sunkan December 17, 2025 06:48
{
public function setFoo(
#[Beep]
Foo $new
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have a trailing comma

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and should also be fixed in the readme example and in the other fixed file

@dcolt
Copy link
Collaborator Author

dcolt commented Dec 19, 2025

This requires #15 or #35 to have the trailing comma.
But I can do the fixed in advance, but it will fail without either of those two PRs

@dcolt dcolt marked this pull request as ready for review December 19, 2025 02:28
elseif (
!$tokensCollection->sameLine(
$tokensCollection->parenthesisOpener($stackPtr),
$tokensCollection->parenthesisCloser($stackPtr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing comma missing?

public function setFoo(
#[Beep]
Foo $new
): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this wrong?
Perhaps the fixed version should only fix the single problem the test is testing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it is wrong.

The tests use all sniffs available, and even for the formatting, but since I don't have #35 merged yet I apparently missed this. I apparently just fixed it in the other test, not this one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or wait, you weren't referring to the missing ,?
@bix0r what part is wrong with this one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually referring to the empty method body. Isn't supposed to be: ): void {}. But yeah, I did miss the trailing comma :o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants