Skip to content

Commit

Permalink
Bump required PHP to 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored and SpacePossum committed Dec 22, 2021
1 parent fe85ada commit c619e16
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 87 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -11,23 +11,20 @@ jobs:
matrix:
include:
- operating-system: 'ubuntu-20.04'
php-version: '7.2'
php-version: '7.4'
job-description: 'with lowest deps'
composer-flags: '--prefer-stable --prefer-lowest' # should be checked on lowest supported PHP version

- operating-system: 'ubuntu-20.04'
php-version: '7.2'
php-version: '7.4'
job-description: 'with Sf ^4'
execute-flex-with-symfony-version: '^4' # Explicit check for Sf 4.x compatibility

- operating-system: 'ubuntu-20.04'
php-version: '7.3'
php-version: '7.4'
job-description: 'with Sf ^5'
execute-flex-with-symfony-version: '^5' # Explicit check for Sf 5.x compatibility

- operating-system: 'ubuntu-20.04'
php-version: '7.4'

- operating-system: 'ubuntu-20.04'
php-version: '8.0'
job-description: 'with Sf ^6'
Expand Down
4 changes: 2 additions & 2 deletions .php-cs-fixer.php-lowest.php
Expand Up @@ -12,8 +12,8 @@
* with this source code in the file LICENSE.
*/

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");
if (PHP_VERSION_ID < 70400 || PHP_VERSION_ID >= 70500) {
fwrite(STDERR, "PHP CS Fixer's config for PHP-LOWEST can be executed only on lowest supported PHP version - ~7.4.0.\n");
fwrite(STDERR, "Running it on higher PHP version would falsy expect more changes, eg `mixed` type on PHP 8.\n");

exit(1);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^7.2.5 || ^8.0",
"php": "^7.4 || ^8.0",
"ext-json": "*",
"ext-tokenizer": "*",
"composer/semver": "^3.2",
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/build.sh
Expand Up @@ -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.2.5
composer config platform.php 2> /dev/null || composer config platform.php 7.4

# install package deps without dev-deps / remove already installed dev-deps
# box can ignore dev-deps, but dev-deps, when installed, may lower version of prod-deps
Expand Down
2 changes: 1 addition & 1 deletion doc/installation.rst
Expand Up @@ -5,7 +5,7 @@ Installation
Requirements
------------

PHP needs to be a minimum version of PHP 7.2.5.
PHP needs to be a minimum version of PHP 7.4.

Installation
------------
Expand Down
6 changes: 1 addition & 5 deletions docker-compose.override.yaml.dist
@@ -1,7 +1,7 @@
version: '3.8'

services:
php-7.2: &php
php-7.4: &php
build:
args:
DOCKER_USER_ID: 1000 # replace with your user id (most likely 1000)
Expand All @@ -11,10 +11,6 @@ services:
# Required for Docker Linux until natively supported.
# See https://github.com/docker/for-linux/issues/264
host.docker.internal: 172.17.0.1
php-7.3:
<<: *php
php-7.4:
<<: *php
php-8.0:
<<: *php
php-8.1:
Expand Down
10 changes: 2 additions & 8 deletions docker-compose.yaml
@@ -1,20 +1,14 @@
version: '3.8'

services:
php-7.2: &php
build: docker/php-7.2
php-7.4: &php
build: docker/php-7.4
working_dir: /app
volumes:
- .:/app
environment:
PHP_IDE_CONFIG: serverName=php-cs-fixer
PHP_CS_FIXER_ALLOW_XDEBUG: 1
php-7.3:
<<: *php
build: docker/php-7.3
php-7.4:
<<: *php
build: docker/php-7.4
php-8.0:
<<: *php
build: docker/php-8.0
Expand Down
26 changes: 0 additions & 26 deletions docker/php-7.2/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions docker/php-7.2/xdebug.ini

This file was deleted.

26 changes: 0 additions & 26 deletions docker/php-7.3/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions docker/php-7.3/xdebug.ini

This file was deleted.

4 changes: 2 additions & 2 deletions php-cs-fixer
Expand Up @@ -39,10 +39,10 @@ set_error_handler(static function ($severity, $message, $file, $line) {

exit(1);
} elseif (
\PHP_VERSION_ID < 70205
\PHP_VERSION_ID < 70400
|| \PHP_VERSION_ID >= 80200
) {
fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.2.5 and maximum version of PHP 8.1.*.\n");
fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.1.*.\n");
fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n");

if (getenv('PHP_CS_FIXER_IGNORE_ENV')) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Smoke/CiIntegrationTest.php
Expand Up @@ -148,7 +148,7 @@ public function testIntegration(
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.2.5 and maximum version of PHP 8.1.*.
$optionalIncompatibilityWarning = 'PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.1.*.
Current PHP version: '.PHP_VERSION.'.
Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.
';
Expand Down

0 comments on commit c619e16

Please sign in to comment.