Skip to content

Commit e222af2

Browse files
committed
Allow for empty class bodies to be abbreviated, too.
1 parent 2441346 commit e222af2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ there are no arguments passed to the constructor.
297297
new Foo();
298298
```
299299

300+
If class contains no additional declarations (such as an exception that exists only extend another exception with a new type),
301+
then the body of the class SHOULD be abbreviated as `{}` and placed on the same line as the previous symbol,
302+
separated by a space. For example:
303+
304+
```php
305+
class MyException extends \RuntimeException {}
306+
```
307+
300308
### 4.1 Extends and Implements
301309

302310
The `extends` and `implements` keywords MUST be declared on the same line as

0 commit comments

Comments
 (0)