Search code examples
phppsr-2

psr-2 more then one blank line


Is it a valid way(PSR-2) to write code with 2 blank lines in a row?

For example:

$a = 1;


$b = 2;

Or there always has to be only one blank line beetween $a and $b?


Solution

  • Yes, this is acceptable by the PSR-2 standard.

    The standard indicates:

    Blank lines MAY be added to improve readability and to indicate related blocks of code.