Skip to content

Allow targeting multiline elements in AbstractPropertyConstantAndEnumCaseSpacing #1762

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vojtech-dobes
Copy link

Hi, feel free to reject this if you don't like this. I love the nice spacing I can define with the various Spacing sniffs. I use 1 empty line above phpDoc and 0 lines otherwise. To me it's about visually putting apart more complex elements (with phpDoc a property basically becomes multiline even if it's just single-line on its own). But I noticed that multiline const are still crammed together. The reason is that they don't really need phpDoc (eg. PHPStan can read them precisely just fine without phpDoc).

I've tried to implement these 2 extra options minLinesCountBeforeMultiline & maxLinesCountBeforeMultiline as optional. By default they are off (value -1). They also still respect other rules, so most demanding value always wins.

The max call on line 105 I'm not sure about. I noticed weird behavior when the min is higher than max, so this ensures max is always same or higher than min.

@kukulich kukulich force-pushed the master branch 2 times, most recently from 287f803 to cda88e6 Compare July 5, 2025 14:03
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.

1 participant