Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions PHPCompatibilityWP/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
As of WP 5.2, the new minimum PHP requirement is PHP 5.6.20.
As of WP 6.3, the new minimum PHP requirement is PHP 7.0.0.
As of WP 6.6, the new minimum PHP requirement is PHP 7.2.24.
As of WP 7.0, the new minimum PHP requirement is PHP 7.4.0.
Add the following in your project PHP_CodeSniffer ruleset to enforce this:
<config name="testVersion" value="7.2-"/>
<config name="testVersion" value="7.4-"/>

This directive is not included in this ruleset as individual projects may use
a different (higher) minimum PHP version.
Expand All @@ -28,10 +29,10 @@
* JsonSerializable: since WP 4.4.0 and removed since WP 5.3.0.
* array_replace_recursive(): since WP 4.5.3 up to 5.2.x. The polyfill was removed in WP 5.3.
* is_iterable(): since WP 4.9.6 and removed since WP 6.6.0.
* is_countable(): since WP 4.9.6
* is_countable(): since WP 4.9.6 and removed since WP 7.0.0.
* IMAGETYPE_WEBP and IMG_WEBP: since WP 5.8.0 and removed since WP 6.6.0.
* array_key_first(): since WP 5.9.0
* array_key_last(): since WP 5.9.0
* array_key_first(): since WP 5.9.0 and removed since WP 7.0.0.
* array_key_last(): since WP 5.9.0 and removed since WP 7.0.0.
* str_contains(): since WP 5.9.0
* str_starts_with(): since WP 5.9.0
* str_ends_with(): since WP 5.9.0
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ The WordPress minimum PHP requirement was 5.2.4 up to WP 5.1.
* As of WP 5.2, the new minimum PHP requirement is PHP 5.6.20.
* As of WP 6.3, the new minimum PHP requirement is PHP 7.0.0.
* As of WP 6.6, the new minimum PHP requirement is PHP 7.2.24.
* As of WP 7.0, the new minimum PHP requirement is PHP 7.4.0.

To enforce for PHPCompatibility to run against the PHP version you want to support, add `--runtime-set testVersion 7.2-` to your command-line command or add `<config name="testVersion" value="7.2-"/>` to your [custom ruleset](https://github.com/PHPCompatibility/PHPCompatibility#using-a-custom-ruleset), replacing `7.2-` with a `testVersion` of your choice.
To enforce for PHPCompatibility to run against the PHP version you want to support, add `--runtime-set testVersion 7.4-` to your command-line command or add `<config name="testVersion" value="7.4-"/>` to your [custom ruleset](https://github.com/PHPCompatibility/PHPCompatibility#using-a-custom-ruleset), replacing `7.4-` with a `testVersion` of your choice.

For example:
```bash
Expand Down
Loading