Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to PHP 7.2+ #10343

Merged
merged 17 commits into from Jan 3, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 14 additions & 34 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -22,12 +22,6 @@ jobs:
strategy:
matrix:
php-version:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
Expand All @@ -37,30 +31,34 @@ jobs:
os: [ubuntu-latest]
experimental: [false]
include:
- php-version: "5.3"
- php-version: "7.2"
dependencies: highest
os: ubuntu-latest
experimental: false
- php-version: "5.3"
- php-version: "7.2"
dependencies: lowest
os: ubuntu-latest
experimental: false
- php-version: "8.0"
- php-version: "8.1"
dependencies: highest
os: ubuntu-latest
experimental: false
- php-version: "8.1"
os: windows-latest
dependencies: locked
experimental: false
- php-version: "8.0"
- php-version: "8.1"
os: macos-latest
dependencies: locked
experimental: false
- php-version: "8.1"
dependencies: lowest
- php-version: "8.2"
dependencies: lowest-ignore
os: ubuntu-latest
experimental: false
- php-version: "8.1"
dependencies: highest
experimental: true
- php-version: "8.2"
dependencies: highest-ignore
os: ubuntu-latest
experimental: false
experimental: true

steps:
- name: "Checkout"
Expand Down Expand Up @@ -99,24 +97,6 @@ jobs:
if: "matrix.dependencies == 'locked'"
run: "composer install ${{ env.COMPOSER_FLAGS }}"

- name: "Require latest PHPUnitBridge for PHP 8.x"
if: "startsWith(matrix.php-version, '8.')"
# using ~ here to avoid issues with windows CLI removing the ^
run: 'composer require --no-update --dev "symfony/phpunit-bridge:~5.2"'

# temporary fix until phpunit-bridge has a release supporting 8.1
- name: "Require latest dev PHPUnitBridge for PHP 8.1"
if: "matrix.experimental"
# using ~ here to avoid issues with windows CLI removing the ^
run: 'composer require --no-update --dev "symfony/phpunit-bridge:~5.4@dev"'

- name: "Set ignored deprecations for php 8.1+ on lowest or locked deps"
if: "matrix.php-version >= '8.1' && !contains(matrix.dependencies, 'highest')"
run: "echo \"SYMFONY_DEPRECATIONS_HELPER=baselineFile=./tests/deprecations-8.1.json&max[direct]=0\" >> $GITHUB_ENV"

- name: "Update dev requirements to latest available for the current PHP even on locked builds as they are not bundled dependencies"
run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }} symfony/phpunit-bridge phpspec/prophecy phpdocumentor/* sebastian/* doctrine/instantiator"

- name: "Run install again using composer binary from source"
run: "bin/composer install ${{ env.COMPOSER_FLAGS }}"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
php-version:
- "5.3"
- "7.2"
- "latest"

steps:
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/phpstan.yml
Expand Up @@ -17,11 +17,16 @@ jobs:
name: "PHPStan"

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}

strategy:
matrix:
php-version:
- "7.4"
include:
- php-version: "7.2"
experimental: false
- php-version: "8.1"
experimental: true
fail-fast: false

steps:
- name: "Checkout"
Expand All @@ -46,12 +51,16 @@ jobs:
key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}"

- name: "Install highest dependencies from composer.json using composer binary provided by system"
- name: "Install highest dependencies"
if: "matrix.experimental == true"
run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"

- name: "Install PHPStan"
# Locked to phpunit 7.5 here as newer ones have void return types which break inheritance
run: "bin/composer require --dev phpstan/phpstan:^1.0 phpstan/phpstan-phpunit:^1.0 phpstan/phpstan-deprecation-rules:^1 phpstan/phpstan-strict-rules:^1 phpunit/phpunit:^7.5.20 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}"
- name: "Install locked dependencies"
if: "matrix.experimental == false"
run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}"

- name: "Initialize PHPUnit sources"
run: "vendor/bin/simple-phpunit --filter NO_TEST_JUST_AUTOLOAD_THANKS"

- name: "Run PHPStan"
run: "vendor/bin/phpstan analyse --configuration=phpstan/config.neon"
run: "composer phpstan"
32 changes: 14 additions & 18 deletions composer.json
Expand Up @@ -22,7 +22,7 @@
}
],
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0",
"php": "^7.2.5 || ^8.0",
"composer/ca-bundle": "^1.0",
"composer/metadata-minifier": "^1.0",
"composer/semver": "^3.0",
Expand All @@ -31,17 +31,20 @@
"justinrainbow/json-schema": "^5.2.11",
"psr/log": "^1.0 || ^2.0",
"seld/jsonlint": "^1.4",
"seld/phar-utils": "^1.0",
"symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0",
"symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
"symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
"symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0",
"react/promise": "^1.2 || ^2.7",
"seld/phar-utils": "^1.2",
"symfony/console": "^5.4.1 || ^6.0",
"symfony/filesystem": "^5.4 || ^6.0",
"symfony/finder": "^5.4 || ^6.0",
"symfony/process": "^5.4 || ^6.0",
"react/promise": "^2.8",
"composer/pcre": "^1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0",
"phpspec/prophecy": "^1.10"
"symfony/phpunit-bridge": "^6.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1",
"phpstan/phpstan-strict-rules": "^1"
},
"suggest": {
"ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages",
Expand All @@ -50,13 +53,13 @@
},
"config": {
"platform": {
"php": "5.3.9"
"php": "7.2.5"
},
"platform-check": false
},
"extra": {
"branch-alias": {
"dev-main": "2.2-dev"
"dev-main": "2.3-dev"
}
},
"autoload": {
Expand All @@ -80,18 +83,11 @@
"scripts": {
"compile": "@php -dphar.readonly=0 bin/compile",
"test": "@php simple-phpunit",
"phpstan-setup": [
"@composer config platform --unset",
"@composer update",
"@composer require --dev phpstan/phpstan:^1.0 phpstan/phpstan-phpunit:^1.0 phpstan/phpstan-deprecation-rules:^1 phpstan/phpstan-strict-rules:^1 phpunit/phpunit:^7.5.20 --with-all-dependencies",
"git checkout composer.json composer.lock"
],
"phpstan": "@php vendor/bin/phpstan analyse --configuration=phpstan/config.neon"
},
"scripts-descriptions": {
"compile": "Compile composer.phar",
"test": "Run all tests",
"phpstan-setup": "Prepare environment to run PHPStan locally (must be run with PHP7.4)",
"phpstan": "Runs PHPStan (after phpstan-setup was executed, must be run with PHP7.4)"
},
"support": {
Expand Down