diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b30845046c..e4f41efd31 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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. diff --git a/.github/workflows/build-phar.yml b/.github/workflows/build-phar.yml index 6c13cba0a2..96590cda08 100644 --- a/.github/workflows/build-phar.yml +++ b/.github/workflows/build-phar.yml @@ -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 }}" diff --git a/.github/workflows/quicktest.yml b/.github/workflows/quicktest.yml index 43d4790dee..f76f8a2508 100644 --- a/.github/workflows/quicktest.yml +++ b/.github/workflows/quicktest.yml @@ -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' }})" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83b47b812e..6c25ae69fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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' @@ -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" @@ -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 diff --git a/README.md b/README.md index 9a500edd9c..f5c7b132fa 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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). diff --git a/composer.json b/composer.json index 28cdb07b79..8e05c30d38 100644 --- a/composer.json +++ b/composer.json @@ -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": "*" diff --git a/phpstan.neon.dist b/phpstan.neon.dist index d5d4a78f78..bdc3e983d3 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -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