Hello,

I wanted to request an exception rule for PSR-12.

Currently there is this rule:

> Method and function names MUST NOT be declared with space after the 
method name. The opening brace MUST go on its own line, and the closing 
brace MUST go on the next line following the body.  [...] When the argument 
list is split across multiple lines, the closing parenthesis and opening 
brace MUST be placed together on their own line with one space between them.
 
This means, if you want to use PHP 8 constructor property promotion with 
PSR-12 it looks like this:

class User { 
  public function __construct( 
          private Service $service 
  ){
  }
 } 

which I think looks broken. Could we add a rule that opening and closing 
brace can be on the same line when used for constructor and if body is 
empty?

So it would be ok to look like this:

class User { 
  public function __construct( 
          private Service $service 
  ){}
 } 

?

-- 
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 php-fig+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/a44fd59f-19b0-4e4f-a7d1-0ccab71746adn%40googlegroups.com.

Reply via email to