Skip to content

Commit 1913d01

Browse files
committed
Bump minimum PHP-version and dependencies
1 parent 7e72208 commit 1913d01

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

.github/workflows/php.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
php-version: ['8.1', '8.2', '8.3', '8.4']
22+
php-version: ['8.3', '8.4', '8.5']
2323

2424
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0
2525
with:
@@ -46,15 +46,15 @@ jobs:
4646
fail-fast: false
4747
matrix:
4848
operating-system: [ubuntu-latest]
49-
php-versions: ['8.1', '8.2', '8.3', '8.4']
49+
php-versions: ['8.3', '8.4', '8.5']
5050

5151
steps:
5252
- name: Setup PHP, with composer and extensions
5353
# https://github.com/shivammathur/setup-php
5454
uses: shivammathur/setup-php@v2
5555
with:
5656
php-version: ${{ matrix.php-versions }}
57-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
57+
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, sodium, spl, xml
5858
tools: composer
5959
ini-values: error_reporting=E_ALL
6060
coverage: pcov
@@ -86,15 +86,15 @@ jobs:
8686
run: composer install --no-progress --prefer-dist --optimize-autoloader
8787

8888
- name: Run unit tests with coverage
89-
if: ${{ matrix.php-versions == '8.4' }}
89+
if: ${{ matrix.php-versions == '8.5' }}
9090
run: vendor/bin/phpunit
9191

9292
- name: Run unit tests (no coverage)
93-
if: ${{ matrix.php-versions != '8.4' }}
93+
if: ${{ matrix.php-versions != '8.5' }}
9494
run: vendor/bin/phpunit --no-coverage
9595

9696
- name: Save coverage data
97-
if: ${{ matrix.php-versions == '8.4' }}
97+
if: ${{ matrix.php-versions == '8.5' }}
9898
uses: actions/upload-artifact@v6
9999
with:
100100
name: coverage-data
@@ -109,15 +109,16 @@ jobs:
109109
fail-fast: true
110110
matrix:
111111
operating-system: [windows-latest]
112-
php-versions: ['8.1', '8.2', '8.3', '8.4']
112+
php-versions: ['8.3', '8.4', '8.5']
113113

114114
steps:
115115
- name: Setup PHP, with composer and extensions
116116
# https://github.com/shivammathur/setup-php
117117
uses: shivammathur/setup-php@v2
118118
with:
119119
php-version: ${{ matrix.php-versions }}
120-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml, zip
120+
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl,\
121+
pcre, posix, sodium, spl, xml, zip
121122
tools: composer
122123
ini-values: error_reporting=E_ALL
123124
coverage: none
@@ -163,9 +164,9 @@ jobs:
163164
uses: shivammathur/setup-php@v2
164165
with:
165166
# Should be the higest supported version, so we can use the newest tools
166-
php-version: '8.4'
167+
php-version: '8.5'
167168
tools: composer, composer-require-checker, composer-unused, phpcs, phpstan
168-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
169+
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, sodium, spl, xml
169170

170171
- name: Setup problem matchers for PHP
171172
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
@@ -203,7 +204,7 @@ jobs:
203204
run: composer-unused
204205

205206
- name: PHP Code Sniffer
206-
run: phpcs
207+
run: vendor/bin/phpcs
207208

208209
- name: PHPStan
209210
run: |
@@ -224,8 +225,8 @@ jobs:
224225
uses: shivammathur/setup-php@v2
225226
with:
226227
# Should be the lowest supported version
227-
php-version: '8.1'
228-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
228+
php-version: '8.3'
229+
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, sodium, spl, xml
229230
tools: composer
230231
coverage: none
231232

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
}
3535
},
3636
"require": {
37-
"php": "^8.1",
37+
"php": "^8.3",
3838
"ext-pdo": "*",
3939

40-
"simplesamlphp/assert": "^1.8",
41-
"simplesamlphp/composer-module-installer": "^1.4",
42-
"simplesamlphp/saml2": "^5.0",
40+
"simplesamlphp/assert": "^1.9",
41+
"simplesamlphp/composer-module-installer": "^1.5",
42+
"simplesamlphp/saml2": "^6.0",
4343

44-
"simplesamlphp/simplesamlphp": "^2.1",
45-
"symfony/http-foundation": "^6.4"
44+
"simplesamlphp/simplesamlphp": "^2.5@dev",
45+
"symfony/http-foundation": "^7.4"
4646
},
4747
"require-dev": {
48-
"simplesamlphp/simplesamlphp-test-framework": "^1.9"
48+
"simplesamlphp/simplesamlphp-test-framework": "^1.11"
4949
},
5050
"support": {
5151
"issues": "https://github.com/simplesamlphp/simplesamlphp-module-consent/issues",

tests/src/Controller/ConsentControllerTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function testGetconsentAccept(): void
7777

7878
$c = new Controller\ConsentController(self::$config, self::$session);
7979
$c->setAuthState(new class () extends State {
80-
public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array
80+
public static function loadState(string $id, string $stage, bool $allowMissing = false): array
8181
{
8282
return [
8383
'Destination' => [
@@ -95,6 +95,7 @@ public function __construct()
9595
{
9696
}
9797

98+
9899
public function saveConsent(string $userId, string $destinationId, string $attributeSet): bool
99100
{
100101
// stub
@@ -124,7 +125,7 @@ public function testGetconsentDecline(): void
124125

125126
$c = new Controller\ConsentController(self::$config, self::$session);
126127
$c->setAuthState(new class () extends State {
127-
public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array
128+
public static function loadState(string $id, string $stage, bool $allowMissing = false): array
128129
{
129130
return [
130131
'StateId' => 'someStateId',
@@ -165,7 +166,7 @@ public function testNoconsent(): void
165166

166167
$c = new Controller\ConsentController(self::$config, self::$session);
167168
$c->setAuthState(new class () extends State {
168-
public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array
169+
public static function loadState(string $id, string $stage, bool $allowMissing = false): array
169170
{
170171
return [
171172
'consent:showNoConsentAboutService' => 'something that evals to true',
@@ -270,7 +271,7 @@ public function testNoState(string $controller): void
270271

271272

272273
/**
273-
* @return array
274+
* @return array<array<string>>
274275
*/
275276
public static function stateTestsProvider(): array
276277
{

0 commit comments

Comments
 (0)