Skip to content

Commit baae3fd

Browse files
committed
Drop support for PHP < 7.2
This commit is a plain version drop. This commit does **not** include: * Removing any work-arounds which _may_ exist in the codebase, to support PHP < 7.2. * Modernizing the codebase. These things can be addressed at will in follow up PRs. Fixes 2606
1 parent 637711c commit baae3fd

File tree

8 files changed

+15
-30
lines changed

8 files changed

+15
-30
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ When you introduce new `public` sniff properties, or your sniff extends a class
6565
* PHP_CodeSniffer 3.13.0 or higher
6666
* PHPCSUtils 1.1.0 or higher
6767
* PHPCSExtra 1.4.0 or higher
68-
* PHPUnit 4.x - 9.x
68+
* PHPUnit 8.x - 9.x
6969

7070
The WordPress Coding Standards use the `PHP_CodeSniffer` native unit test framework for unit testing the sniffs.
7171

.github/workflows/quicktest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
strategy:
2525
matrix:
26-
php: [ '5.4', 'latest' ]
26+
php: [ '7.2', 'latest' ]
2727
dependencies: [ 'lowest', 'stable' ]
2828

2929
name: QTest - PHP ${{ matrix.php }} on PHPCS ${{ matrix.dependencies }}

.github/workflows/unit-tests.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ jobs:
2626
runs-on: ubuntu-latest
2727
strategy:
2828
matrix:
29-
php: [ '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.5' ]
29+
php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.5' ]
3030
dependencies: [ 'lowest', 'stable' ]
3131
extensions: [ '' ]
3232
coverage: [false]
3333

3434
include:
35-
- php: '7.2'
35+
- php: '8.1'
3636
dependencies: 'stable'
3737
extensions: ':mbstring' # = Disable Mbstring.
3838
coverage: true # Make sure coverage is recorded for this too.
3939

4040
# Run code coverage builds against high/low PHP and high/low PHPCS.
41-
- php: '5.4'
41+
- php: '7.2'
4242
dependencies: 'stable'
4343
extensions: ''
4444
coverage: true
45-
- php: '5.4'
45+
- php: '7.2'
4646
dependencies: 'lowest'
4747
extensions: ''
4848
coverage: true
@@ -56,15 +56,11 @@ jobs:
5656
coverage: true
5757

5858
# Test against dev versions of all dependencies with select PHP versions for early detection of issues.
59-
- php: '5.4'
60-
dependencies: 'dev'
61-
extensions: ''
62-
coverage: false
63-
- php: '7.0'
59+
- php: '7.2'
6460
dependencies: 'dev'
6561
extensions: ''
6662
coverage: false
67-
- php: '7.4'
63+
- php: '8.1'
6864
dependencies: 'dev'
6965
extensions: ''
7066
coverage: false

.phpcs.xml.dist

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,13 @@
5050

5151
<!-- Linting is done in a separate CI job, no need to duplicate it. -->
5252
<exclude name="Generic.PHP.Syntax"/>
53-
54-
<!-- WordPressCS still has a PHP 5.4 minimum. -->
55-
<exclude name="Modernize.FunctionCalls.Dirname"/>
5653
</rule>
5754

5855
<!-- Check code for cross-version PHP compatibility. -->
59-
<config name="testVersion" value="5.4-"/>
56+
<config name="testVersion" value="7.2-"/>
6057
<rule ref="PHPCompatibility">
6158
<!-- Exclude PHP constants back-filled by PHPCS. -->
62-
<exclude name="PHPCompatibility.Constants.NewConstants.t_finallyFound"/>
63-
<exclude name="PHPCompatibility.Constants.NewConstants.t_yieldFound"/>
64-
<exclude name="PHPCompatibility.Constants.NewConstants.t_ellipsisFound"/>
65-
<exclude name="PHPCompatibility.Constants.NewConstants.t_powFound"/>
66-
<exclude name="PHPCompatibility.Constants.NewConstants.t_pow_equalFound"/>
67-
<exclude name="PHPCompatibility.Constants.NewConstants.t_spaceshipFound"/>
68-
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesceFound"/>
6959
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesce_equalFound"/>
70-
<exclude name="PHPCompatibility.Constants.NewConstants.t_yield_fromFound"/>
7160
<exclude name="PHPCompatibility.Constants.NewConstants.t_readonlyFound"/>
7261
</rule>
7362

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![codecov.io](https://codecov.io/gh/WordPress/WordPress-Coding-Standards/graph/badge.svg?token=UzFYn0RzVG&branch=develop)](https://codecov.io/gh/WordPress/WordPress-Coding-Standards?branch=develop)
1111

1212
[![Minimum PHP Version](https://img.shields.io/packagist/php-v/wp-coding-standards/wpcs.svg?maxAge=3600)](https://packagist.org/packages/wp-coding-standards/wpcs)
13-
[![Tested on PHP 5.4 to 8.4](https://img.shields.io/badge/tested%20on-PHP%205.4%20|%205.5%20|%205.6%20|%207.0%20|%207.1%20|%207.2%20|%207.3%20|%207.4%20|%208.0%20|%208.1%20|%208.2%20|%208.3%20|%208.4-green.svg?maxAge=2419200)](https://github.com/WordPress/WordPress-Coding-Standards/actions/workflows/unit-tests.yml)
13+
[![Tested on PHP 7.2 to 8.4](https://img.shields.io/badge/tested%20on-PHP%207.2%20|%207.3%20|%207.4%20|%208.0%20|%208.1%20|%208.2%20|%208.3%20|%208.4-green.svg?maxAge=2419200)](https://github.com/WordPress/WordPress-Coding-Standards/actions/workflows/unit-tests.yml)
1414

1515
[![License: MIT](https://poser.pugx.org/wp-coding-standards/wpcs/license)](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/LICENSE)
1616
[![Total Downloads](https://poser.pugx.org/wp-coding-standards/wpcs/downloads)](https://packagist.org/packages/wp-coding-standards/wpcs/stats)
@@ -53,7 +53,7 @@ This project is a collection of [PHP_CodeSniffer](https://github.com/PHPCSStanda
5353
## Minimum Requirements
5454

5555
The WordPress Coding Standards package requires:
56-
* PHP 5.4 or higher with the following extensions enabled:
56+
* PHP 7.2 or higher with the following extensions enabled:
5757
- [Filter](https://www.php.net/book.filter)
5858
- [libxml](https://www.php.net/book.libxml)
5959
- [Tokenizer](https://www.php.net/book.tokenizer)

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=5.4",
19+
"php": ">=7.2",
2020
"ext-filter": "*",
2121
"ext-libxml": "*",
2222
"ext-tokenizer": "*",
@@ -27,7 +27,7 @@
2727
},
2828
"require-dev": {
2929
"phpcompatibility/php-compatibility": "^9.0",
30-
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
30+
"phpunit/phpunit": "^8.0 || ^9.0",
3131
"phpcsstandards/phpcsdevtools": "^1.2.0",
3232
"php-parallel-lint/php-parallel-lint": "^1.4.0",
3333
"php-parallel-lint/php-console-highlighter": "^1.0.0"

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
phpVersion: 70100 # Needs to be 70100 or higher... sigh...
2+
phpVersion: 70200
33
level: 5
44
paths:
55
- WordPress

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
55
backupGlobals="true"
66
bootstrap="./Tests/bootstrap.php"
77
convertErrorsToExceptions="true"

0 commit comments

Comments
 (0)