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

PHPCS: Use PHPCompatibilityWP and use it correctly #1974

Merged
merged 1 commit into from
Sep 5, 2018
Merged

PHPCS: Use PHPCompatibilityWP and use it correctly #1974

merged 1 commit into from
Sep 5, 2018

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Sep 5, 2018

This PR:

  • Switches the repo over to use PHPCompatibilityWP rather than PHPCompatibility.
    As this repo and ruleset is aimed at a WordPress project, using the PHPCompatibilityWP ruleset is the better choice to prevent false positives for PHP functions and constants which are back-filled by WP.
  • Switches the dependency over to use the repo in the PHPCompatibility GitHub organisation rather than the one in wimg's personal account.
  • Removes a PHPCS annotation to suppress a notice about a back-filled function, which is no longer needed.
  • Adds a testVersion config directive to the PHPCS ruleset to tell PHPCompatibility with which PHP versions the code should be compatible.
    Without this directive, PHPCompatibility only throws errors/warnings about deprecated/removed PHP features. Not about the use of new features not supported in older PHP versions.
    Adding the directive fixes this.
  • Add relevant links to the inline documentation of the Travis script and the ruleset.

References:

This PR:
* Switches the repo over to use `PHPCompatibilityWP` rather than `PHPCompatibility`.
    As this repo and ruleset is aimed at a WordPress project, using the `PHPCompatibilityWP` ruleset is the better choice to prevent false positives for PHP functions and constants which are back-filled by WP.
* Switches the dependency over to use the repo in the `PHPCompatibility` GitHub organisation rather than the one in `wimg`'s personal account.
* Removes a PHPCS annotation to suppress a notice about a back-filled function, which is no longer needed.
* Adds a `testVersion` config directive to the PHPCS ruleset to tell PHPCompatibility with which PHP versions the code should be compatible.
    Without this directive, PHPCompatibility only throws errors/warnings about deprecated/removed PHP features. Not about the use of new features not supported in older PHP versions.
    Adding the directive fixes this.
* Add relevant links to the inline documentation of the Travis script and the ruleset.

### References:
* https://github.com/PHPCompatibility/PHPCompatibilityWP
* https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions
* PHPCompatibility/PHPCompatibility#688
* https://github.com/PHPCompatibility/PHPCompatibility/releases/tag/8.2.0
@codecov
Copy link

codecov bot commented Sep 5, 2018

Codecov Report

Merging #1974 into develop will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             develop   #1974   +/-   ##
=========================================
  Coverage       5.38%   5.38%           
  Complexity      1802    1802           
=========================================
  Files            143     143           
  Lines           6257    6257           
=========================================
  Hits             337     337           
  Misses          5920    5920
Impacted Files Coverage Δ Complexity Δ
core/class-kirki-helper.php 58.85% <0%> (ø) 95 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27c384e...e52e809. Read the comment docs.

@aristath aristath merged commit 42ac3a0 into themeum:develop Sep 5, 2018
@jrfnl jrfnl deleted the feature/use-phpcompatibility-wp branch September 5, 2018 18:29
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.

None yet

2 participants