From 9fc365c4153c23d01a85b90ef6ec33381324d575 Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Wed, 1 Jun 2022 17:36:37 -0500 Subject: [PATCH 1/3] Update the abstract/final section to cover all modifier keywords. --- spec.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/spec.md b/spec.md index 66dbad4..f133682 100644 --- a/spec.md +++ b/spec.md @@ -579,13 +579,19 @@ public function process(string $algorithm, &...$parts) } ``` -### 4.6 `abstract`, `final`, and `static` +### 4.6 Modifier keywords -When present, the `abstract` and `final` declarations MUST precede the -visibility declaration. +Properties and methods of a class have numerous keyword modifiers that alter how the +engine and language handles them. When present, they MUST be in the following order: -When present, the `static` declaration MUST come after the visibility -declaration. +* Inheritance modifier: `abstract` or `final` +* Visibility modifier: `public`, `protected`, or `private` +* Scope modifier: `static` +* Mutation modifier: `readonly` +* Type declaration +* Name + +All keywords MUST be on a single line, and MUST be separated by a single space. ```php Date: Wed, 1 Jun 2022 17:40:25 -0500 Subject: [PATCH 2/3] Include example of a readonly class. --- spec.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec.md b/spec.md index f133682..978e3df 100644 --- a/spec.md +++ b/spec.md @@ -611,6 +611,11 @@ abstract class ClassName // method body } } + +readonly class ValueObject +{ + // ... +} ``` ### 4.7 Method and Function Calls From 2a5bed578f77aae4816581b30349b20dc95ff7e8 Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Fri, 10 Jun 2022 11:30:22 -0500 Subject: [PATCH 3/3] Capitalization Co-authored-by: Korvin Szanto --- spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.md b/spec.md index 978e3df..7341db7 100644 --- a/spec.md +++ b/spec.md @@ -579,7 +579,7 @@ public function process(string $algorithm, &...$parts) } ``` -### 4.6 Modifier keywords +### 4.6 Modifier Keywords Properties and methods of a class have numerous keyword modifiers that alter how the engine and language handles them. When present, they MUST be in the following order: