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
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ When in doubt how to proceed with a ticket, feel free to leave a comment with sp
Please make sure your code conforms to the PHPCS coding standard, is covered by tests and that all the PHP_CodeSniffer
unit tests still pass.

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

To help you with this, a number of convenience scripts are available:
* `composer check-all` will run the `cs` + `test` checks in one go.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-phar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
matrix:
# Deliberately missing PHP 8.0 as that PHAR is build and used in the test workflow.
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']
php: ['7.2', '7.3', '7.4', '8.1', '8.2', '8.3', '8.4', 'nightly']

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

Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-24.04-arm', 'windows-latest']
php: ['7.2', 'latest']

include:
- php: '5.4'
os: 'ubuntu-24.04-arm'
custom_ini: false
# Installing on Windows with PHP 5.4 runs into all sorts of problems with Composer.
# See this issue for more context (yes, I've seen this problem before):
# @link https://github.com/PHPCSStandards/composer-installer/pull/213
- php: '5.5'
os: 'windows-latest'
custom_ini: false
php: ['7.2', '8.1', 'latest']

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

Expand Down
38 changes: 8 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,13 @@ jobs:
# code conditions.
matrix:
os: ['ubuntu-latest', 'windows-latest']
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']
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
custom_ini: [false]

exclude:
# Installing on Windows with PHP 5.4 runs into all sorts of problems (which are not ours).
- php: '5.4'
os: 'windows-latest'

include:
# Skip test runs on builds which are also run in the coverage job.
# Note: the tests on PHP 7.2 will still be run as the coverage build uses custom_ini settings for that version.
- php: '5.4'
os: 'ubuntu-latest'
skip_tests: true
- php: '5.5'
os: 'windows-latest'
# Note: the tests on PHP 8.1 will still be run as the coverage build uses custom_ini settings for that version.
- php: '7.2'
skip_tests: true
- php: '8.4'
skip_tests: true
Expand All @@ -86,10 +77,10 @@ jobs:
libxml_minor: '2.13'

# Extra builds running only the unit tests with different PHP ini settings.
- php: '5.5'
- php: '7.4'
os: 'ubuntu-latest'
custom_ini: true
- php: '7.0'
- php: '8.3'
os: 'ubuntu-latest'
custom_ini: true
- php: '8.0'
Expand Down Expand Up @@ -181,9 +172,7 @@ jobs:
run: |
# Set the "short_open_tag" ini to make sure specific conditions are tested.
# Also turn on error_reporting to ensure all notices are shown.
if [[ ${{ matrix.custom_ini }} == true && "${{ matrix.php }}" == '5.5' ]]; then
echo 'PHP_INI=error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On, asp_tags=On' >> "$GITHUB_OUTPUT"
elif [[ ${{ matrix.custom_ini }} == true && "${{ matrix.php }}" != '5.5' ]]; then
if [[ ${{ matrix.custom_ini }} == true ]]; then
echo 'PHP_INI=error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On' >> "$GITHUB_OUTPUT"
else
echo 'PHP_INI=error_reporting=-1, display_errors=On' >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -268,23 +257,12 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
php: ['8.4']
php: ['7.2', '8.4']
custom_ini: [false]

include:
- php: '5.4'
os: 'ubuntu-latest'
custom_ini: false
# Installing on Windows with PHP 5.4 runs into all sorts of problems with Composer.
# Considering PHP 5.4 is ancient, I deem it acceptable to run coverage on Windows on PHP 5.5.
# See this issue for more context (yes, I've seen this problem before):
# @link https://github.com/PHPCSStandards/composer-installer/pull/213
- php: '5.5'
os: 'windows-latest'
custom_ini: false

# Also run one coverage build with custom ini settings.
- php: '7.2'
- php: '8.1'
os: 'ubuntu-latest'
custom_ini: true

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![License](https://img.shields.io/github/license/PHPCSStandards/PHP_CodeSniffer)](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt)

![Minimum PHP Version](https://img.shields.io/packagist/dependency-v/squizlabs/php_codesniffer/php.svg)
[![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]
[![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]

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

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

## Requirements

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.
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.

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).

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy"
},
"require": {
"php": ">=5.4.0",
"php": ">=7.2.0",
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*"
Expand Down
4 changes: 3 additions & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
parameters:
phpVersion: 70100 # Should be 50400, but PHPStan only accepts 70100 or higher...
phpVersion:
min: 70200
max: 80499
level: 0
paths:
- src
Expand Down