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

Compatibility-fix for PHPCS 3.4.0 #1517

Merged
merged 1 commit into from Nov 2, 2018

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 2, 2018

A fix for upstream issue squizlabs/PHP_CodeSniffer#1574 - tokenize binary casts as T_BINARY_CAST - has been committed to PHPCS and will be included in the PHPCS 3.4.0 release.

  • The upstream change fixes a false negative in the PHP.TypeCasts sniff.
  • There are two more sniffs which look at cast tokens PHP.YodaConditions and WP.EnqueuedResourceParameters.
    • For the first, I've just added a unit test documenting the behaviour.
    • For the second, I realized that while the sniff handled cast tokens, this specific situation wasn't tested at all. So I've added tests to that effect, including tests using binary casts.

A fix for upstream issue 1574 - tokenize binary casts as `T_BINARY_CAST` - has been committed to PHPCS and will be included in the PHPCS 3.4.0 release.

* The upstream change fixes a false negative in the `PHP.TypeCasts` sniff.
* There are two more sniffs which look at cast tokens `PHP.YodaConditions` and `WP.EnqueuedResourceParameters`.
    - For the first, I've just added a unit test documenting the behaviour.
    - For the second, I realized that the use of cast tokens wasn't tested at all. So I've added tests to that effect, including tests using binary casts.
@GaryJones GaryJones merged commit 4a1bb7e into develop Nov 2, 2018
@GaryJones GaryJones deleted the feature/phpcs-3.4.0-compatibility branch November 2, 2018 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants