Skip to content
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

Allow multiple new lines in union and intersection declaration #265

Conversation

DaDeather
Copy link
Contributor

I just noticed that my latest implementation only allowed a "single" new line in between the type declaration for union and intersection types.

See:
https://phpstan.org/r/107386a9-94b0-4dc1-bc22-ac2d6db189c4

This change would allow multiple new lines between those to be handled correctly.

@DaDeather DaDeather force-pushed the 258-allow-new-lines-inbetween-type-declarations-extended-multiline branch from 9d5ff82 to edfe931 Compare February 16, 2025 14:48
@@ -4211,6 +4212,176 @@ public function provideMultiLinePhpDocData(): iterable
]),
];

yield [
'Multiline PHPDoc with multiple new line within union type declaration',
'/**' . PHP_EOL .
Copy link
Contributor

Choose a reason for hiding this comment

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

nowdoc can be used here for more readability

Copy link
Member

Choose a reason for hiding this comment

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

Like here dc7c469

Copy link
Member

Choose a reason for hiding this comment

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

But maybe not because that's only in PrinterTest.

@ondrejmirtes ondrejmirtes force-pushed the 258-allow-new-lines-inbetween-type-declarations-extended-multiline branch from edfe931 to 3a918f8 Compare February 17, 2025 20:24
@ondrejmirtes ondrejmirtes changed the base branch from 2.1.x to 2.0.x February 17, 2025 20:25
@ondrejmirtes ondrejmirtes merged commit 51087f8 into phpstan:2.0.x Feb 17, 2025
43 of 44 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@DaDeather
Copy link
Contributor Author

Thank you!

Sure, happy to help! But rather thank you for also fixing the tests that failed in this regard!

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.

3 participants