Skip to content

Rewrite Section 4.6 entry in the PER-CS 2.0 to 3.0 migration guide#145

Open
rodrigoprimo wants to merge 1 commit into
php-fig:masterfrom
rodrigoprimo:update-section-4.6-in-migration-guide-3.0
Open

Rewrite Section 4.6 entry in the PER-CS 2.0 to 3.0 migration guide#145
rodrigoprimo wants to merge 1 commit into
php-fig:masterfrom
rodrigoprimo:update-section-4.6-in-migration-guide-3.0

Conversation

@rodrigoprimo
Copy link
Copy Markdown
Contributor

The current Section 4.6 entry in migration-3.0.md says:

At least one of readonly, get-visibility, and set-visibility must be specified. If at least one is specified, the others may be omitted.

As far as I can see, this sentence does not match what actually changed in 3.0, and the related readonly string $three; is not related to the changes introduced in 3.0 and is incorrect per the spec, as it is missing the visibility modifier.

What I believe did actually change in Section 4.6 in 3.0, all introduced by #99:

  • The set-visibility modifier (public(set), protected(set), private(set)) was added to the modifier ordering, between general visibility and static. Compare the 2.0 modifier order (no set-visibility) with the 3.0 modifier order.
  • All modifier keywords MUST be all lower-case. New in 3.0; the 2.0 spec only required keywords to be on a single line separated by spaces.
  • The public keyword MAY be omitted when using a set-visibility on a public-read property. New in 3.0 (refined within Document how to use aviz #99 by commit 5724087).

This PR proposes rewriting the entry to cover those three rules and updating the example accordingly:

  • The readonly string $three; line is removed, since (as discussed above) it appears to be inconsistent with Section 4.3.
  • A new counter-example PUBLIC PROTECTED(set) string $three; is added to illustrate the new lower-case requirement.

Happy to revise or drop any of this if I'm misreading the spec.

PER-CS 3.0 introduced three rules in Section 4.6: the
set-visibility modifier was added to the modifier ordering, all
modifier keywords MUST be all lower-case, and the `public`
keyword MAY be omitted when using a set-visibility on a
public-read property. The current entry does not describe these
accurately.

This commit rewrites the entry and updates the example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant