Skip to content

Conversation

@dingo-d
Copy link
Member

@dingo-d dingo-d commented Jun 22, 2022

Closes #93

Grouped similar chapters in a logical structure.

Reviewing this from a code comparison view might be... challenging.

I recommend just opening the new structure and the old one and comparing if everything was copied over correctly.

The proposed chapter grouping is the following:

General
  Opening and Closing PHP Tags
  No Shorthand PHP Tags
  Single and Double Quotes

Naming
  Naming Conventions
  Interpolation for Naming Dynamic Hooks

Whitespace
  Space Usage
  Indentation
  Remove Trailing Spaces

Formatting
  Brace Style
  Declaring Arrays
  Multiline Function Calls

Object-Oriented Programming
  Only One Object Structure (Class/Interface/Trait) per File

Control Structures
  Use `elseif`, Not `else if`
  Yoda Conditions

Operators
  Ternary Operator
  Error Control Operator `@`

Database
  Database Queries
  Formatting SQL Statements

Recommendations
  Self-Explanatory Flag Values for Function Arguments
  Clever Code
  Closures (Anonymous Functions)
  Regular Expressions
  Don't `extract()`

@dingo-d dingo-d requested a review from a team June 22, 2022 12:28
@dingo-d dingo-d self-assigned this Jun 22, 2022
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.

I've verified this in detail and can confirm this complies with what the PR intends to do and no other textual changes have been made.

Only remark I have is that there are trailing spaces in two places in the file, which should probably be removed (line 358 and line 446).

@dingo-d dingo-d requested review from GaryJones and ntwb June 25, 2022 08:41
@dingo-d
Copy link
Member Author

dingo-d commented Jun 25, 2022

@jrfnl I'm looking at the changes, but cannot see the trailing spaces in my editor.

@jrfnl
Copy link
Member

jrfnl commented Jun 25, 2022

@jrfnl I'm looking at the changes, but cannot see the trailing spaces in my editor.

Your editor may have removed them, try saving and seeing if there is a diff (and make sure that whitespace is not being ignored for the diff).

image
image

@dingo-d
Copy link
Member Author

dingo-d commented Jun 25, 2022

Indeed, my PhpStorm didn't show them, but Sublime did 😅

Thanks for catching it!

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.

All good (@dingo-d You can fix up things like this in the original commit)

@dingo-d
Copy link
Member Author

dingo-d commented Jun 25, 2022

Just a note for other maintainers, please don't merge this until #92 has been merged. It's going to be easier to fixup this PR than vice versa

Grouped similar chapters in a logical structure.
@dingo-d dingo-d force-pushed the reorganize-chapters branch from 4e55913 to 2b5790e Compare July 21, 2022 15:53
@dingo-d
Copy link
Member Author

dingo-d commented Jul 21, 2022

I've rebased the PR so that the code examples are pulled from the master branch.

I've found 2 grammar issues (?) that I've replaced:

even when using a different code style, we recommend you still adhere to the WordPress Coding Standards with regards to these best practices.

with

even when using a different code style, we recommend you still adhere to the WordPress Coding Standards in regard to these best practices.

with regards to -> in regard to

And

consider whether it can be broken into two or more shorter blocks, functions, or methods

with

consider whether it can be broken into two or shorter blocks, functions, or methods

Removed the unnecessary more word.

If you have any objections to these two changes I can revert them, but they are really minor.

Other than that, no content has been changed.

@dingo-d dingo-d requested a review from jrfnl July 21, 2022 15:59
@jrfnl
Copy link
Member

jrfnl commented Jul 21, 2022

And

consider whether it can be broken into two or more shorter blocks, functions, or methods

with

consider whether it can be broken into two or shorter blocks, functions, or methods

I don't think this is correct as it changes the meaning of the sentence.

Adding a comma might be better ? But if I'm honest, I think the original sentence is correct and the grammar check wrong 😝

consider whether it can be broken into two or more, shorter blocks, functions, or methods

@dingo-d
Copy link
Member Author

dingo-d commented Jul 22, 2022

Now that I read it, it does make more sense to leave it as is instead of removing the more.

I blame PhpStorm's grammar checker 😅

Will revert it.

The first sentence does need a singular regard, so I'll leave this change 🙂

@dingo-d
Copy link
Member Author

dingo-d commented Jul 22, 2022

@GaryJones @ntwb can you take a look?

Copy link
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

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

In terms of ordering, then ✅ - so long as the content is on the page, I don't think it matters too much what order it's in, and if there's some value in aligning with a PSR/external standards, go for it.

@dingo-d dingo-d merged commit dff1d86 into master Jul 23, 2022
@dingo-d dingo-d deleted the reorganize-chapters branch July 23, 2022 10:15
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.

Restructuring the PHP coding standards

4 participants