Browse Source

minor #6067 Bump minimum PHP version to 7.2 (keradus)

This PR was merged into the master branch.

Discussion
----------

Bump minimum PHP version to 7.2

Only 0.2% installations are using PHP 7.1
https://packagist.org/packages/friendsofphp/php-cs-fixer/php-stats#3.2

Commits
-------

a4b59f009 Bump minimum PHP version to 7.2
Dariusz Ruminski 3 years ago
parent
commit
96a9f4f3d1

+ 3 - 3
.github/workflows/ci.yml

@@ -11,7 +11,7 @@ jobs:
       matrix:
         include:
           - operating-system: 'ubuntu-20.04'
-            php-version: '7.1'
+            php-version: '7.2'
             job-description: 'with lowest deps'
             composer-flags: '--prefer-stable --prefer-lowest' # should be checked on lowest supported PHP version
 
@@ -124,8 +124,8 @@ jobs:
           COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         run: php vendor/bin/php-coveralls --verbose
 
-      - name: Run PHP CS Fixer for PHP 7.1 types
-        if: matrix.php-version == '7.1' # we run on lowest supported version, running it on higher would falsy expect more changes, eg `mixed` type on PHP 8
+      - name: Run PHP CS Fixer for PHP 7.2 types
+        if: matrix.php-version == '7.2' # we run on lowest supported version, running it on higher would falsy expect more changes, eg `mixed` type on PHP 8
         run: php php-cs-fixer fix --diff --dry-run -v --config .php-cs-fixer.php-lowest.php
 
       - name: Run PHP CS Fixer

+ 2 - 2
.php-cs-fixer.php-lowest.php

@@ -10,8 +10,8 @@
  * with this source code in the file LICENSE.
  */
 
-if (PHP_VERSION_ID <= 70103 || PHP_VERSION_ID >= 70200) {
-    fwrite(STDERR, "PHP CS Fixer's config for PHP-LOWEST can be executed only on lowest supported PHP version - 7.1.*.\n");
+if (PHP_VERSION_ID < 70205 || PHP_VERSION_ID >= 70300) {
+    fwrite(STDERR, "PHP CS Fixer's config for PHP-LOWEST can be executed only on lowest supported PHP version - ~7.2.5.\n");
     fwrite(STDERR, "Running it on higher PHP version would falsy expect more changes, eg `mixed` type on PHP 8.\n");
     exit(1);
 }

+ 7 - 0
CHANGELOG.md

@@ -24,6 +24,13 @@ Changelog for v3.3.0
 * minor #6085 Dx: reuse WhitespacesAnalyzer::detectIndent (kubawerlos)
 * minor #6087 AbstractProxyFixer - more tests (SpacePossum)
 
+Changelog for v3.2.1
+---------------------
+
+experimental release
+
+* Require PHP 7.2
+
 Changelog for v3.2.0
 --------------------
 

+ 1 - 1
composer.json

@@ -14,7 +14,7 @@
         }
     ],
     "require": {
-        "php": "^7.1.3 || ^8.0",
+        "php": "^7.2.5 || ^8.0",
         "ext-json": "*",
         "ext-tokenizer": "*",
         "composer/semver": "^3.2",

+ 1 - 1
dev-tools/build.sh

@@ -2,7 +2,7 @@
 set -eu
 
 # ensure that deps will work on lowest supported PHP version
-composer config platform.php 2> /dev/null || composer config platform.php 7.1.3
+composer config platform.php 2> /dev/null || composer config platform.php 7.2.5
 
 # require suggested packages
 composer require --no-update symfony/polyfill-mbstring

+ 1 - 1
doc/installation.rst

@@ -5,7 +5,7 @@ Installation
 Requirements
 ------------
 
-PHP needs to be a minimum version of PHP 7.1.3.
+PHP needs to be a minimum version of PHP 7.2.5.
 
 Installation
 ------------

+ 2 - 2
php-cs-fixer

@@ -39,10 +39,10 @@ set_error_handler(static function ($severity, $message, $file, $line) {
 
         exit(1);
     } elseif (
-        \PHP_VERSION_ID < 70103
+        \PHP_VERSION_ID < 70205
         || \PHP_VERSION_ID >= 80100
     ) {
-        fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.1.3 and maximum version of PHP 8.0.*.\n");
+        fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.0.*.\n");
         fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n");
 
         if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {

+ 1 - 1
tests/Smoke/CiIntegrationTest.php

@@ -148,7 +148,7 @@ final class CiIntegrationTest extends AbstractSmokeTest
 You may find an UPGRADE guide at https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v4.0.0/UPGRADE-v4.md .
 ';
 
-        $optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 7.1.3 and maximum version of PHP 8.0.*.
+        $optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.0.*.
 Current PHP version: '.PHP_VERSION.'.
 Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.
 ';