From 70dbcc165e28fe3af42bed1c787c8d5ebe70e4bb Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Wed, 10 Aug 2022 09:39:49 -0500 Subject: [PATCH 1/2] Omit () on zero-argument anonymous classes. --- spec.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec.md b/spec.md index 0652335..3264c74 100644 --- a/spec.md +++ b/spec.md @@ -1187,20 +1187,25 @@ the list of `implements` interfaces does not wrap. If the list of interfaces wraps, the brace MUST be placed on the line immediately following the last interface. +If the anonymous class has no arguments, the `()` after `class` MUST be omitted. + ```php Date: Tue, 30 Aug 2022 17:21:00 -0500 Subject: [PATCH 2/2] Long-form braces Co-authored-by: Korvin Szanto --- spec.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec.md b/spec.md index 3264c74..814d611 100644 --- a/spec.md +++ b/spec.md @@ -1205,7 +1205,9 @@ $instance = new class($a) extends \Foo implements \Countable, \Serializable { - public function __construct(public int $a) {} + public function __construct(public int $a) + { + } // Class content }; ```