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

Adding one object structure per file #52

Merged
merged 8 commits into from
Apr 12, 2021

Conversation

dingo-d
Copy link
Member

@dingo-d dingo-d commented Apr 9, 2021

This addition will allow WordPress/WordPress-Coding-Standards#1802 to be merged to the coding standards.

This will encourage having one class/interface/trait per file.

Feel free to suggest better wording, I tried to be as clear as possible.

This addition will allow WordPress/WordPress-Coding-Standards#1802 to be merged to the coding standards.

This will encourage having one class/interface/trait per file.
@dingo-d dingo-d requested review from GaryJones, jrfnl and ntwb April 9, 2021 14:05
@dingo-d dingo-d self-assigned this Apr 9, 2021
@jrfnl
Copy link
Member

jrfnl commented Apr 11, 2021

For the record - this is how it was announced in the blog post about coding standards on Make last year:

One class-like definition per file

Proposed standards:

  • There should only be one class-like definition (class/trait/interface) per file.

This has already been a best practice for a while and will now be formalized.

Copy link
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

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

@dingo-d Thanks for doing this! Text looks good to me.

It does feel a bit "off" for this to be lumped in into the "Naming Conventions" section though, so I suggest adding it as its own section just below that one.

Other than that, just some punctuation fixes to be made and it is good to go.

wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
wordpress-coding-standards/php.md Outdated Show resolved Hide resolved
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, add @jrfnl suggestions and feel free to merge

@dingo-d
Copy link
Member Author

dingo-d commented Apr 12, 2021

Thanks for the suggestions 👍🏼 I wasn't sure if this should have its own subchapter or not, so I just placed them at the end of the naming part, because that's closest to the issue (the way files should be named and all). But it does make more sense to be on its own.

I've committed the changes you've suggested, so this can be merged 🙂

@dingo-d dingo-d requested a review from jrfnl April 12, 2021 06:13
@jrfnl jrfnl merged commit dbcfcaa into master Apr 12, 2021
@jrfnl jrfnl deleted the adding-one-object-structure-per-file-rule branch April 12, 2021 06:22
@SergeyBiryukov SergeyBiryukov mentioned this pull request Apr 18, 2021
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.

3 participants