Skip to content
Snippets Groups Projects
Unverified Commit f67a07c1 authored by Tim van Dijen's avatar Tim van Dijen Committed by GitHub
Browse files

Raise PHP functional level to 7.2 (#1201)

* Bump to PHP 7.2
parent a1e36040
No related branches found
No related tags found
No related merge requests found
build: false build: false
shallow_clone: false shallow_clone: false
version: '1.19.0.{build}' version: '2.0.0.{build}'
platform: 'x64' platform: 'x64'
clone_folder: C:\projects\simplesamlphp clone_folder: C:\projects\simplesamlphp
environment: environment:
matrix: matrix:
- PHP_VERSION: "7.0"
- PHP_VERSION: "7.1"
- PHP_VERSION: "7.2" - PHP_VERSION: "7.2"
- PHP_VERSION: "7.3" - PHP_VERSION: "7.3"
......
...@@ -15,10 +15,9 @@ stages: ...@@ -15,10 +15,9 @@ stages:
################ ################
php: php:
- 7.0
- 7.1
- 7.2 - 7.2
- 7.3 - 7.3
- 7.4
env: env:
- COMMAND="composer install" - COMMAND="composer install"
...@@ -33,13 +32,13 @@ script: ...@@ -33,13 +32,13 @@ script:
jobs: jobs:
fast_finish: true fast_finish: true
allow_failures: allow_failures:
- php: 7.0 - php: 7.2
env: Psalm env: Psalm
- php: 7.0 - php: 7.2
env: Security check (composer install) env: Security check (composer install)
- php: 7.0 - php: 7.2
env: Security check (composer update) env: Security check (composer update)
- php: 7.0 - php: 7.2
env: PHP Codesniffer env: PHP Codesniffer
include: include:
...@@ -49,7 +48,7 @@ jobs: ...@@ -49,7 +48,7 @@ jobs:
########################## ##########################
- stage: pre-conditions - stage: pre-conditions
php: 7.0 php: 7.2
env: Syntax check PHP env: Syntax check PHP
before_script: before_script:
- composer install - composer install
...@@ -57,7 +56,7 @@ jobs: ...@@ -57,7 +56,7 @@ jobs:
- vendor/bin/check-syntax-php.sh - vendor/bin/check-syntax-php.sh
- stage: pre-conditions - stage: pre-conditions
php: 7.1 php: 7.2
env: Syntax check PHP env: Syntax check PHP
before_script: before_script:
- composer install - composer install
...@@ -65,7 +64,7 @@ jobs: ...@@ -65,7 +64,7 @@ jobs:
- vendor/bin/check-syntax-php.sh - vendor/bin/check-syntax-php.sh
- stage: pre-conditions - stage: pre-conditions
php: 7.2 php: 7.3
env: Syntax check PHP env: Syntax check PHP
before_script: before_script:
- composer install - composer install
...@@ -73,7 +72,7 @@ jobs: ...@@ -73,7 +72,7 @@ jobs:
- vendor/bin/check-syntax-php.sh - vendor/bin/check-syntax-php.sh
- stage: pre-conditions - stage: pre-conditions
php: 7.3 php: 7.4
env: Syntax check PHP env: Syntax check PHP
before_script: before_script:
- composer install - composer install
......
...@@ -45,9 +45,8 @@ throws an exception in a specific situation: ...@@ -45,9 +45,8 @@ throws an exception in a specific situation:
$this->expectException(ExpectedException::class); $this->expectException(ExpectedException::class);
``` ```
Refer to [the `phpunit 5.7` documentation](https://phpunit.de/manual/5.7/en/installation.html) Refer to [the `phpunit 8.5` documentation](https://phpunit.readthedocs.io/en/8.5/)
for more information on how to write tests. We currently use the `phpunit 5.7` for more information on how to write tests.
since it is the last version to support php 5.6.
Once you have implemented your tests, you can run them locally. First, Once you have implemented your tests, you can run them locally. First,
make sure the `config` directory is **not** in the root of your make sure the `config` directory is **not** in the root of your
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"files": ["tests/_autoload_modules.php"] "files": ["tests/_autoload_modules.php"]
}, },
"require": { "require": {
"php": ">=7.0", "php": ">=7.2",
"ext-SPL": "*", "ext-SPL": "*",
"ext-zlib": "*", "ext-zlib": "*",
"ext-pcre": "*", "ext-pcre": "*",
......
...@@ -157,11 +157,11 @@ class Config ...@@ -157,11 +157,11 @@ class Config
'descr' => [ 'descr' => [
Translate::noop('PHP %minimum% or newer is needed. You are running: %current%'), Translate::noop('PHP %minimum% or newer is needed. You are running: %current%'),
[ [
'%minimum%' => '7.0', '%minimum%' => '7.2',
'%current%' => explode('-', phpversion())[0] '%current%' => explode('-', phpversion())[0]
] ]
], ],
'enabled' => version_compare(phpversion(), '7.0', '>=') 'enabled' => version_compare(phpversion(), '7.2', '>=')
] ]
]; ];
$store = $this->config->getString('store.type', ''); $store = $this->config->getString('store.type', '');
......
...@@ -7,9 +7,6 @@ core-account-disco-clearchoices: ...@@ -7,9 +7,6 @@ core-account-disco-clearchoices:
core-login: core-login:
path: /login/{as} path: /login/{as}
defaults: { _controller: 'SimpleSAML\Module\core\Controller\Login:login', as: null } 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: core-logout:
path: /logout/{as} path: /logout/{as}
defaults: { _controller: 'SimpleSAML\Module\core\Controller\Login:logout' } defaults: { _controller: 'SimpleSAML\Module\core\Controller\Login:logout' }
......
...@@ -28,7 +28,7 @@ function core_hook_sanitycheck(&$hookinfo) ...@@ -28,7 +28,7 @@ function core_hook_sanitycheck(&$hookinfo)
$hookinfo['info'][] = '[core] In config.php technicalcontact_email is set properly'; $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.'; $hookinfo['info'][] = '[core] You are running a PHP version suitable for SimpleSAMLphp.';
} else { } else {
$hookinfo['errors'][] = '[core] You are running an old PHP installation. ' . $hookinfo['errors'][] = '[core] You are running an old PHP installation. ' .
......
...@@ -123,8 +123,8 @@ if (\SimpleSAML\Module::isModuleEnabled('radius')) { ...@@ -123,8 +123,8 @@ if (\SimpleSAML\Module::isModuleEnabled('radius')) {
$funcmatrix = []; $funcmatrix = [];
$funcmatrix[] = [ $funcmatrix[] = [
'required' => 'required', 'required' => 'required',
'descr' => 'PHP Version >= 7.0. You run: ' . phpversion(), 'descr' => 'PHP Version >= 7.2. You run: ' . phpversion(),
'enabled' => version_compare(phpversion(), '7.0', '>=') 'enabled' => version_compare(phpversion(), '7.2', '>=')
]; ];
foreach ($functionchecks as $func => $descr) { foreach ($functionchecks as $func => $descr) {
$funcmatrix[] = ['descr' => $descr[1], 'required' => $descr[0], 'enabled' => function_exists($func)]; $funcmatrix[] = ['descr' => $descr[1], 'required' => $descr[0], 'enabled' => function_exists($func)];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment