terax6669 opened a new issue, #6716:
URL: https://github.com/apache/netbeans/issues/6716

   ### Description
   
   https://www.php-fig.org/per/coding-style/#44-methods-and-functions
   
   > If a function or method contains no statements or comments (such as an 
empty no-op implementation or when using constructor property promotion), then 
the body SHOULD be abbreviated as {} and placed on the same line as the 
previous symbol, separated by a space.
   
   Currently there is no empty body option in formatting options. Code 
formatted by NetBeans is out of spec:
   ```php
   class Point
   {
        public function __construct(private int $x, private int $y)
        {
                
        }
   
        public function __construct(
                public readonly int $x,
                public readonly int $y,
        )
        {
                
        }
   }
   ```
   
   As the spec is `SHOULD`, personally I wouldn't mind if there was also an 
option to do this:
   ```php
   class Name
   {
        public function __construct(private int $arg)
        {
        }
   }
   ```
   
   ### Use case/motivation
   
   PER standard compliance.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to