Skip to content

Clarify "Visibility must be declared" in the context of aviz #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jrfnl opened this issue May 23, 2025 · 2 comments · Fixed by #115
Closed

Clarify "Visibility must be declared" in the context of aviz #114

jrfnl opened this issue May 23, 2025 · 2 comments · Fixed by #115

Comments

@jrfnl
Copy link
Contributor

jrfnl commented May 23, 2025

Related to #98 and #99

From the currently published PSR-PER (and not changed in master):

4.3 Properties and Constants
Visibility MUST be declared on all properties.

For the purpose of automated tooling and keeping aviz in mind, should the above be interpreted to mean "the get/read visibility must always be explicitly declared, independently of a potentially declared write visibility" ? Or should it be interpreted to mean "as long as there is any visibility declared, be it aviz or non-aviz, this rule is satisfied" ?

Edit: just for the record - I presume the latter is the case based on #99, but just want to make sure

@Crell
Copy link
Collaborator

Crell commented May 23, 2025

Good catch. I agree, it should be understood as "at least some kind of visibility is specified." Implicit public-read when specifying public(set) is a nice feature, and we don't want to forbid it. 😄 I'll see if I can clarify the language.

@jrfnl
Copy link
Contributor Author

jrfnl commented May 23, 2025

Thanks for confirming @Crell . I'll proceed for PHPCS based on this statement.

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 a pull request may close this issue.

2 participants