Allow targeting multiline elements in AbstractPropertyConstantAndEnumCaseSpacing #1762
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.