Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpcs Is there a rule to disallow empty lines?

Tags:

php

phpcs

psr-2

Is there a rule that I can use with phpcs that limits the number of consecutive empty lines to e.g. 3? I currently use PSR2, which does not take this into consideration at all.

like image 670
Chris Avatar asked Dec 12 '25 21:12

Chris


1 Answers

I believe there is one called no_extra_consecutive_blank_lines, you can find more on available rules PHP-CS-Fixer. I do not however know how you would be able to specify the number of lines to allow.

Seeing as we are busy with TypeScript at the moment we are also looking at TSLint, which does seem to allow specifying number of lines; Example-TSLINT (just FYI).

like image 167
David 'the bald ginger' Avatar answered Dec 14 '25 13:12

David 'the bald ginger'



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!