wp-phptidy icon indicating copy to clipboard operation
wp-phptidy copied to clipboard

Added logic to insert whitespace after NOT operators

Open shawcohn opened this issue 10 years ago • 3 comments

This is for adding space after NOT operators to conform with the WordPress PHP Coding Standards. See the section on logical comparisons under spacing: https://make.wordpress.org/core/handbook/coding-standards/php/#space-usage

shawcohn avatar Mar 01 '15 15:03 shawcohn

Can you post a few "before and after" examples of this new behavior?

scribu avatar Mar 01 '15 20:03 scribu

Actually, I think this would be a good time to introduce some phpunit tests that cover all the branches touched by the pull request: T_IF, T_WHILE etc.

scribu avatar Mar 01 '15 20:03 scribu

I know that, compared to implementing a new feature, writing tests seems like a chore, but it's necessary, particularly for such a script, with many many branches.

If you're not familiar with PHPUnit, just give me the test cases, i.e. "this bit of incorrect PHP should look like this after I run it through wp-phptidy", I'll translate them to working PHPUnit tests.

scribu avatar Mar 01 '15 20:03 scribu