From b4b67f5691c37cd115972cf655c5b8259b5c01ff Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Tue, 15 Oct 2024 12:53:41 -0500 Subject: [PATCH 1/2] Document how to use aviz. --- spec.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec.md b/spec.md index e2604b9..87e097b 100644 --- a/spec.md +++ b/spec.md @@ -659,12 +659,13 @@ engine and language handles them. When present, they MUST be in the following or * Inheritance modifier: `abstract` or `final` * Visibility modifier: `public`, `protected`, or `private` +* Set-visibility modifier: `public(set)`, `protected(set)`, or `private(set)` * 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. +All keywords MUST be on a single line, and MUST be separated by a single space. All keywords MUST be all lower-case. When using a set-visibility on a public-read property, omitting the `public` keyword is RECOMMENDED but NOT REQUIRED. The following is a correct example of modifier keyword usage: @@ -679,6 +680,10 @@ abstract class ClassName private readonly int $beep; + protected private(set) string $name; + + protected(set) string $boop; + abstract protected function zim(); final public static function bar() From 5724087c8742961185a994a2ec3d24a68419a422 Mon Sep 17 00:00:00 2001 From: Larry Garfield Date: Sat, 19 Oct 2024 01:41:15 -0500 Subject: [PATCH 2/2] Soften requirements around omitting `public`. Co-authored-by: Korvin Szanto --- spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.md b/spec.md index 87e097b..f651117 100644 --- a/spec.md +++ b/spec.md @@ -665,7 +665,7 @@ engine and language handles them. When present, they MUST be in the following or * Type declaration * Name -All keywords MUST be on a single line, and MUST be separated by a single space. All keywords MUST be all lower-case. When using a set-visibility on a public-read property, omitting the `public` keyword is RECOMMENDED but NOT REQUIRED. +All keywords MUST be on a single line, and MUST be separated by a single space. All keywords MUST be all lower-case. The `public` keyword MAY be omitted when using a set-visibility on a public-read property. The following is a correct example of modifier keyword usage: