Skip to content

Commit e851630

Browse files
authored
Make it clear that this applies when accessing any class member and not just methods.
1 parent bdbf3ee commit e851630

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

spec.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,21 @@ separated by a space. For example:
308308
class MyException extends \RuntimeException {}
309309
```
310310

311-
When calling a method immeditely after instantiating a new class, the instantiation SHOULD NOT be wrapped in
311+
When accessing a class member immeditely after instantiating a new class, the instantiation SHOULD NOT be wrapped in
312312
parenthesis. For example:
313313

314314
```php
315-
$methodResult = new Foo()->someMethod();
315+
new Foo()->someMethod();
316+
new Foo()->someStaticMethod();
317+
new Foo()->someProperty;
318+
new Foo()::someStaticProperty;
319+
new Foo()::SOME_CONSTANT;
316320
```
317321

318322
And the following SHOULD be avoided:
319323

320324
```php
321-
$methodResult = (new Foo())->someMethod();
325+
(new Foo())->someMethod();
322326
```
323327

324328
### 4.1 Extends and Implements

0 commit comments

Comments
 (0)