Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Allow multiple new lines in union and intersection declaration - #265

#265
Merged
ondrejmirtes merged 1 commit into
phpstan:2.0.xphpstan/phpdoc-parser:2.0.xfrom
DaDeather:258-allow-new-lines-inbetween-type-declarations-extended-multilineDaDeather/phpdoc-parser:258-allow-new-lines-inbetween-type-declarations-extended-multilineCopy head branch name to clipboard
Feb 17, 2025
Merged

Allow multiple new lines in union and intersection declaration#265
ondrejmirtes merged 1 commit into
phpstan:2.0.xphpstan/phpdoc-parser:2.0.xfrom
DaDeather:258-allow-new-lines-inbetween-type-declarations-extended-multilineDaDeather/phpdoc-parser:258-allow-new-lines-inbetween-type-declarations-extended-multilineCopy head branch name to clipboard

Conversation

@DaDeather

Copy link
Copy Markdown
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

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

@DaDeather

Copy link
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.