No, multiple blank lines are not allowed in the current spec. Section 3 refers to a SINGLE blank line:
"The header of a PHP file may consist of a number of different blocks. If present, each of the blocks below MUST be separated by a single blank line, and MUST NOT contain a blank line." https://github.com/php-fig/fig-standards/blob/master/proposed/extended-coding-style-guide.md#3-declare-statements-namespace-and-import-statements Il giorno lunedì 23 aprile 2018 04:24:10 UTC+2, Joe T. ha scritto: > > i'm not in the WG, but i always restrict to 1 blank line between any two > structures - aside from line after opening *{* and before closing *}* > where no blank line is permitted. Extra blank lines feel like something > wasn't finished. It's just... ew. > -jlt > > > On Sunday, 22 April 2018 19:52:02 UTC-4, Greg Sherwood wrote: >> >> Hi, >> >> I wrote the PSR-1 and PSR-2 standards for PHP_CodeSniffer and I'm now >> writing a PSR-12 standard as well. I have a question about this section: >> >> 4.2 Using traits >>> ... >>> When the class has nothing after the use import statement, the class >>> closing brace MUST be on the next line after the use import statement. >>> ... >>> Otherwise it MUST have a blank line after the use import statement. >>> >>> <?php >>> >>> namespace Vendor\Package; >>> >>> use Vendor\Package\FirstTrait; >>> >>> class ClassName >>> { >>> use FirstTrait; >>> >>> private $property; >>> } >> >> >> The rule states that the use import statement must have a blank like >> after it, but should PHPCS enforce a single blank line or at least one >> blank line? Is this valid code? >> >> <?php >> >> namespace Vendor\Package; >> >> use Vendor\Package\FirstTrait; >> >> class ClassName >> { >> use FirstTrait; >> >> >> >> >> private $property; >> } >> >> Thanks >> >> -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/65e70798-df7f-4e73-a4df-2e4ae5fd24f9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
