From f67a07c1dd9986f10fc4d2124c637c9487c07e14 Mon Sep 17 00:00:00 2001 From: Tim van Dijen <tim.dijen@minbzk.nl> Date: Fri, 14 Feb 2020 21:08:35 +0100 Subject: [PATCH] Raise PHP functional level to 7.2 (#1201) * Bump to PHP 7.2 --- .appveyor.yml | 4 +--- .travis.yml | 19 +++++++++---------- TESTING.md | 5 ++--- composer.json | 2 +- modules/admin/lib/Controller/Config.php | 4 ++-- modules/core/config/routes/routes.yaml | 3 --- modules/core/hooks/hook_sanitycheck.php | 2 +- modules/core/www/frontpage_config.php | 4 ++-- 8 files changed, 18 insertions(+), 25 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 78b8a60ee..f61289ad6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,13 +1,11 @@ build: false shallow_clone: false -version: '1.19.0.{build}' +version: '2.0.0.{build}' platform: 'x64' clone_folder: C:\projects\simplesamlphp environment: matrix: - - PHP_VERSION: "7.0" - - PHP_VERSION: "7.1" - PHP_VERSION: "7.2" - PHP_VERSION: "7.3" diff --git a/.travis.yml b/.travis.yml index 3f51b83ca..c2b31acd5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,10 +15,9 @@ stages: ################ php: - - 7.0 - - 7.1 - 7.2 - 7.3 + - 7.4 env: - COMMAND="composer install" @@ -33,13 +32,13 @@ script: jobs: fast_finish: true allow_failures: - - php: 7.0 + - php: 7.2 env: Psalm - - php: 7.0 + - php: 7.2 env: Security check (composer install) - - php: 7.0 + - php: 7.2 env: Security check (composer update) - - php: 7.0 + - php: 7.2 env: PHP Codesniffer include: @@ -49,7 +48,7 @@ jobs: ########################## - stage: pre-conditions - php: 7.0 + php: 7.2 env: Syntax check PHP before_script: - composer install @@ -57,7 +56,7 @@ jobs: - vendor/bin/check-syntax-php.sh - stage: pre-conditions - php: 7.1 + php: 7.2 env: Syntax check PHP before_script: - composer install @@ -65,7 +64,7 @@ jobs: - vendor/bin/check-syntax-php.sh - stage: pre-conditions - php: 7.2 + php: 7.3 env: Syntax check PHP before_script: - composer install @@ -73,7 +72,7 @@ jobs: - vendor/bin/check-syntax-php.sh - stage: pre-conditions - php: 7.3 + php: 7.4 env: Syntax check PHP before_script: - composer install diff --git a/TESTING.md b/TESTING.md index f9bd5c9f6..c46cf4956 100644 --- a/TESTING.md +++ b/TESTING.md @@ -45,9 +45,8 @@ throws an exception in a specific situation: $this->expectException(ExpectedException::class); ``` -Refer to [the `phpunit 5.7` documentation](https://phpunit.de/manual/5.7/en/installation.html) -for more information on how to write tests. We currently use the `phpunit 5.7` -since it is the last version to support php 5.6. +Refer to [the `phpunit 8.5` documentation](https://phpunit.readthedocs.io/en/8.5/) +for more information on how to write tests. Once you have implemented your tests, you can run them locally. First, make sure the `config` directory is **not** in the root of your diff --git a/composer.json b/composer.json index 36fdec9c5..a8acfa485 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "files": ["tests/_autoload_modules.php"] }, "require": { - "php": ">=7.0", + "php": ">=7.2", "ext-SPL": "*", "ext-zlib": "*", "ext-pcre": "*", diff --git a/modules/admin/lib/Controller/Config.php b/modules/admin/lib/Controller/Config.php index 0961fa9d4..445ff8c23 100644 --- a/modules/admin/lib/Controller/Config.php +++ b/modules/admin/lib/Controller/Config.php @@ -157,11 +157,11 @@ class Config 'descr' => [ Translate::noop('PHP %minimum% or newer is needed. You are running: %current%'), [ - '%minimum%' => '7.0', + '%minimum%' => '7.2', '%current%' => explode('-', phpversion())[0] ] ], - 'enabled' => version_compare(phpversion(), '7.0', '>=') + 'enabled' => version_compare(phpversion(), '7.2', '>=') ] ]; $store = $this->config->getString('store.type', ''); diff --git a/modules/core/config/routes/routes.yaml b/modules/core/config/routes/routes.yaml index 44913ee60..12884b024 100644 --- a/modules/core/config/routes/routes.yaml +++ b/modules/core/config/routes/routes.yaml @@ -7,9 +7,6 @@ core-account-disco-clearchoices: core-login: path: /login/{as} defaults: { _controller: 'SimpleSAML\Module\core\Controller\Login:login', as: null } -core-account: - path: /account/{as} - defaults: { _controller: 'SimpleSAML\Module\core\Controller\Login:account' } core-logout: path: /logout/{as} defaults: { _controller: 'SimpleSAML\Module\core\Controller\Login:logout' } diff --git a/modules/core/hooks/hook_sanitycheck.php b/modules/core/hooks/hook_sanitycheck.php index 9ca2283a2..9bf9132d5 100644 --- a/modules/core/hooks/hook_sanitycheck.php +++ b/modules/core/hooks/hook_sanitycheck.php @@ -28,7 +28,7 @@ function core_hook_sanitycheck(&$hookinfo) $hookinfo['info'][] = '[core] In config.php technicalcontact_email is set properly'; } - if (version_compare(phpversion(), '7.0', '>=')) { + if (version_compare(phpversion(), '7.2', '>=')) { $hookinfo['info'][] = '[core] You are running a PHP version suitable for SimpleSAMLphp.'; } else { $hookinfo['errors'][] = '[core] You are running an old PHP installation. ' . diff --git a/modules/core/www/frontpage_config.php b/modules/core/www/frontpage_config.php index 6669498cb..1cfba39f5 100644 --- a/modules/core/www/frontpage_config.php +++ b/modules/core/www/frontpage_config.php @@ -123,8 +123,8 @@ if (\SimpleSAML\Module::isModuleEnabled('radius')) { $funcmatrix = []; $funcmatrix[] = [ 'required' => 'required', - 'descr' => 'PHP Version >= 7.0. You run: ' . phpversion(), - 'enabled' => version_compare(phpversion(), '7.0', '>=') + 'descr' => 'PHP Version >= 7.2. You run: ' . phpversion(), + 'enabled' => version_compare(phpversion(), '7.2', '>=') ]; foreach ($functionchecks as $func => $descr) { $funcmatrix[] = ['descr' => $descr[1], 'required' => $descr[0], 'enabled' => function_exists($func)]; -- GitLab