PSR-12 and PER specify requirements for blank lines between top-level "blocks."[1][2]
- Opening
<?php
tag.
- File-level docblock.
- One or more declare statements.
- The namespace declaration of the file.
- One or more class-based
use
import statements.
- One or more function-based
use
import statements.
- One or more constant-based
use
import statements.
- The remainder of the code in the file.
Additional blank line settings need to be added to support these requirements.
Missing settings:
- blank lines after opening PHP tag
- blank lines before and after file doc-block
- blank lines before and after declare statements
- differentiate between class, function, and const
use
statements; perhaps a single setting to add blank lines between use groups (class/function/const)
In addition to adding these new settings, the PSR-12 and PER styles should be updated to include/set blank line settings according to their respective style guides.