Skip to content
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

CS: all methods must declare visibility #44543

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Sep 28, 2022

What?

Adds missing visibility modifiers to class methods.

Why?

Visibility expresses whether a method is allowed to be used from outside of the class/from within child classes. It should always be expressly set to clarify intend of how the code should be used.

How?

To not break BC, these have now all been set to public, but a careful review of the visibility for the (non-test) methods is recommended.

To not break BC, these have now all been set to `public`, but a careful review of the visibility for the (non-test) methods is recommended.
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Sep 28, 2022
@jrfnl jrfnl removed the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Sep 28, 2022
@WordPress WordPress deleted a comment from github-actions bot Sep 28, 2022
Copy link
Member

@dmsnell dmsnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For whoever reviews this, the changes seem fine for the block parser but I can't speak for the other files.

@jrfnl can you share what led you to these files specifically? it would be nice to understand that and see if this couldn't be part of a more coordinated effort to have the computer rewrite code.

it would surely be easier for some (myself included) if these were split into separate PRs that touch a related subgroup of modules. as it stands we need everyone on board to examine the changes, or find someone confident enough to review everything, which even for a small change like this can take more focus time than it seems like it ought.

@jrfnl
Copy link
Member Author

jrfnl commented Sep 28, 2022

@jrfnl can you share what led you to these files specifically? it would be nice to understand that and see if this couldn't be part of a more coordinated effort to have the computer rewrite code.

See: #18502 (comment)

it would surely be easier for some (myself included) if these were split into separate PRs that touch a related subgroup of modules. as it stands we need everyone on board to examine the changes, or find someone confident enough to review everything, which even for a small change like this can take more focus time than it seems like it ought.

Well, considering I've been mopping up after Gutenberg after every code merge to Core, I'd appreciate the courtesy of people spending a little time to get this fixed once and for all.

I've split my PRs to mostly only contain one type of change, if someone wants to split it out even further, go right ahead, I won't stop you.

Copy link
Member

@ntwb ntwb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @jrfnl

@Mamaduka Mamaduka merged commit 3772e8c into trunk Oct 3, 2022
@Mamaduka Mamaduka deleted the CS/fix-missing-method-visibility branch October 3, 2022 14:24
@github-actions github-actions bot added this to the Gutenberg 14.3 milestone Oct 3, 2022
@Mamaduka Mamaduka added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Code Quality Issues or PRs that relate to code quality labels Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants