Skip to content

Commit 0820ccb

Browse files
authored
Merge pull request #972 from PHPCSStandards/phpcs-4.0/feature/drop-support-php-lt-7.2
PHPCS now requires PHP 7.2.0+
2 parents 9566773 + a7a27b9 commit 0820ccb

File tree

7 files changed

+17
-48
lines changed

7 files changed

+17
-48
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ When in doubt how to proceed with a ticket, feel free to leave a comment with sp
253253
Please make sure your code conforms to the PHPCS coding standard, is covered by tests and that all the PHP_CodeSniffer
254254
unit tests still pass.
255255

256-
Also, please make sure your code is compatible with the PHP_CodeSniffer minimum supported PHP version, PHP 5.4.
256+
Also, please make sure your code is compatible with the PHP_CodeSniffer minimum supported PHP version, PHP 7.2.
257257

258258
To help you with this, a number of convenience scripts are available:
259259
* `composer check-all` will run the `cs` + `test` checks in one go.

.github/workflows/build-phar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
strategy:
4444
matrix:
4545
# Deliberately missing PHP 8.0 as that PHAR is build and used in the test workflow.
46-
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.1', '8.2', '8.3', '8.4', 'nightly']
46+
php: ['7.2', '7.3', '7.4', '8.1', '8.2', '8.3', '8.4', 'nightly']
4747

4848
name: "Build Phar on PHP: ${{ matrix.php }}"
4949

.github/workflows/quicktest.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,7 @@ jobs:
2929
strategy:
3030
matrix:
3131
os: ['ubuntu-24.04-arm', 'windows-latest']
32-
php: ['7.2', 'latest']
33-
34-
include:
35-
- php: '5.4'
36-
os: 'ubuntu-24.04-arm'
37-
custom_ini: false
38-
# Installing on Windows with PHP 5.4 runs into all sorts of problems with Composer.
39-
# See this issue for more context (yes, I've seen this problem before):
40-
# @link https://github.com/PHPCSStandards/composer-installer/pull/213
41-
- php: '5.5'
42-
os: 'windows-latest'
43-
custom_ini: false
32+
php: ['7.2', '8.1', 'latest']
4433

4534
name: "QuickTest: PHP ${{ matrix.php }} (${{ matrix.os == 'windows-latest' && 'Win' || 'Linux ARM' }})"
4635

.github/workflows/test.yml

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,13 @@ jobs:
5454
# code conditions.
5555
matrix:
5656
os: ['ubuntu-latest', 'windows-latest']
57-
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
57+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
5858
custom_ini: [false]
5959

60-
exclude:
61-
# Installing on Windows with PHP 5.4 runs into all sorts of problems (which are not ours).
62-
- php: '5.4'
63-
os: 'windows-latest'
64-
6560
include:
6661
# Skip test runs on builds which are also run in the coverage job.
67-
# Note: the tests on PHP 7.2 will still be run as the coverage build uses custom_ini settings for that version.
68-
- php: '5.4'
69-
os: 'ubuntu-latest'
70-
skip_tests: true
71-
- php: '5.5'
72-
os: 'windows-latest'
62+
# Note: the tests on PHP 8.1 will still be run as the coverage build uses custom_ini settings for that version.
63+
- php: '7.2'
7364
skip_tests: true
7465
- php: '8.4'
7566
skip_tests: true
@@ -86,10 +77,10 @@ jobs:
8677
libxml_minor: '2.13'
8778

8879
# Extra builds running only the unit tests with different PHP ini settings.
89-
- php: '5.5'
80+
- php: '7.4'
9081
os: 'ubuntu-latest'
9182
custom_ini: true
92-
- php: '7.0'
83+
- php: '8.3'
9384
os: 'ubuntu-latest'
9485
custom_ini: true
9586
- php: '8.0'
@@ -181,9 +172,7 @@ jobs:
181172
run: |
182173
# Set the "short_open_tag" ini to make sure specific conditions are tested.
183174
# Also turn on error_reporting to ensure all notices are shown.
184-
if [[ ${{ matrix.custom_ini }} == true && "${{ matrix.php }}" == '5.5' ]]; then
185-
echo 'PHP_INI=error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On, asp_tags=On' >> "$GITHUB_OUTPUT"
186-
elif [[ ${{ matrix.custom_ini }} == true && "${{ matrix.php }}" != '5.5' ]]; then
175+
if [[ ${{ matrix.custom_ini }} == true ]]; then
187176
echo 'PHP_INI=error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On' >> "$GITHUB_OUTPUT"
188177
else
189178
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
@@ -268,23 +257,12 @@ jobs:
268257
strategy:
269258
matrix:
270259
os: ['ubuntu-latest', 'windows-latest']
271-
php: ['8.4']
260+
php: ['7.2', '8.4']
272261
custom_ini: [false]
273262

274263
include:
275-
- php: '5.4'
276-
os: 'ubuntu-latest'
277-
custom_ini: false
278-
# Installing on Windows with PHP 5.4 runs into all sorts of problems with Composer.
279-
# Considering PHP 5.4 is ancient, I deem it acceptable to run coverage on Windows on PHP 5.5.
280-
# See this issue for more context (yes, I've seen this problem before):
281-
# @link https://github.com/PHPCSStandards/composer-installer/pull/213
282-
- php: '5.5'
283-
os: 'windows-latest'
284-
custom_ini: false
285-
286264
# Also run one coverage build with custom ini settings.
287-
- php: '7.2'
265+
- php: '8.1'
288266
os: 'ubuntu-latest'
289267
custom_ini: true
290268

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![License](https://img.shields.io/github/license/PHPCSStandards/PHP_CodeSniffer)](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt)
1010

1111
![Minimum PHP Version](https://img.shields.io/packagist/dependency-v/squizlabs/php_codesniffer/php.svg)
12-
[![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-brightgreen.svg?maxAge=2419200)][GHA-test]
12+
[![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-brightgreen.svg?maxAge=2419200)][GHA-test]
1313

1414
[GHA-test]: https://github.com/PHPCSStandards/PHP_CodeSniffer/actions/workflows/test.yml
1515

@@ -25,7 +25,7 @@ PHP_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokeni
2525

2626
## Requirements
2727

28-
PHP_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements.
28+
PHP_CodeSniffer requires PHP version 7.2.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements.
2929

3030
If you're using PHP_CodeSniffer as part of a team, or you're running it on a [CI](https://en.wikipedia.org/wiki/Continuous_integration) server, you may want to configure your project's settings [using a configuration file](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file).
3131

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy"
3131
},
3232
"require": {
33-
"php": ">=5.4.0",
33+
"php": ">=7.2.0",
3434
"ext-simplexml": "*",
3535
"ext-tokenizer": "*",
3636
"ext-xmlwriter": "*"

phpstan.neon.dist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
parameters:
2-
phpVersion: 70100 # Should be 50400, but PHPStan only accepts 70100 or higher...
2+
phpVersion:
3+
min: 70200
4+
max: 80499
35
level: 0
46
paths:
57
- src

0 commit comments

Comments
 (0)