Skip to content

Commit 768db5a

Browse files
committed
Bump minimum PHP-version and dependencies
1 parent 3f30f62 commit 768db5a

6 files changed

Lines changed: 45 additions & 53 deletions

File tree

.github/workflows/php.yml

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ 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

24-
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.6
24+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0
2525
with:
2626
php-version: ${{ matrix.php-version }}
2727

@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232

33-
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.6
33+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.0
3434
with:
3535
enable_eslinter: false
3636
enable_jsonlinter: true
@@ -45,15 +45,16 @@ jobs:
4545
fail-fast: false
4646
matrix:
4747
operating-system: [ubuntu-latest]
48-
php-versions: ['8.1', '8.2', '8.3', '8.4']
48+
php-versions: ['8.3', '8.4', '8.5']
4949

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

8788
- name: Run unit tests with coverage
88-
if: ${{ matrix.php-versions == '8.4' }}
89+
if: ${{ matrix.php-versions == '8.5' }}
8990
run: vendor/bin/phpunit
9091

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

9596
- name: Save coverage data
96-
if: ${{ matrix.php-versions == '8.4' }}
97+
if: ${{ matrix.php-versions == '8.5' }}
9798
uses: actions/upload-artifact@v6
9899
with:
99100
name: coverage-data
@@ -107,15 +108,16 @@ jobs:
107108
fail-fast: true
108109
matrix:
109110
operating-system: [windows-latest]
110-
php-versions: ['8.1', '8.2', '8.3', '8.4']
111+
php-versions: ['8.3', '8.4', '8.5']
111112

112113
steps:
113114
- name: Setup PHP, with composer and extensions
114115
# https://github.com/shivammathur/setup-php
115116
uses: shivammathur/setup-php@v2
116117
with:
117118
php-version: ${{ matrix.php-versions }}
118-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, sockets, spl, xml, zip
119+
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl,\
120+
pcre, posix, sockets, sodium, spl, xml, zip
119121
tools: composer
120122
ini-values: error_reporting=E_ALL
121123
coverage: none
@@ -160,11 +162,11 @@ jobs:
160162
uses: shivammathur/setup-php@v2
161163
with:
162164
# Should be the higest supported version, so we can use the newest tools
163-
php-version: '8.4'
165+
php-version: '8.5'
164166
tools: composer, composer-require-checker, composer-unused, phpcs, psalm
165167
# optional performance gain for psalm: opcache
166168
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, \
167-
pcre, posix, sockets, spl, xml
169+
pcre, posix, sockets, sodium, spl, xml
168170

169171
- name: Setup problem matchers for PHP
170172
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
@@ -194,29 +196,15 @@ jobs:
194196
run: composer-unused
195197

196198
- name: PHP Code Sniffer
197-
run: phpcs
199+
run: vendor/bin/phpcs
198200

199-
- name: Psalm
200-
continue-on-error: true
201+
- name: PHPStan
201202
run: |
202-
psalm -c psalm.xml \
203-
--show-info=true \
204-
--shepherd \
205-
--php-version=${{ steps.setup-php.outputs.php-version }}
203+
vendor/bin/phpstan analyze -c phpstan.neon
206204
207-
- name: Psalm (testsuite)
205+
- name: PHPStan (testsuite)
208206
run: |
209-
psalm -c psalm-dev.xml \
210-
--show-info=true \
211-
--shepherd \
212-
--php-version=${{ steps.setup-php.outputs.php-version }}
213-
214-
- name: Psalter
215-
run: |
216-
psalm --alter \
217-
--issues=UnnecessaryVarAnnotation \
218-
--dry-run \
219-
--php-version=${{ steps.setup-php.outputs.php-version }}
207+
vendor/bin/phpstan analyze -c phpstan-dev.neon
220208
221209
security:
222210
name: Security checks
@@ -227,8 +215,9 @@ jobs:
227215
uses: shivammathur/setup-php@v2
228216
with:
229217
# Should be the lowest supported version
230-
php-version: '8.1'
231-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, sockets, spl, xml
218+
php-version: '8.3'
219+
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring,\
220+
openssl, pcre, posix, sockets, sodium, spl, xml
232221
tools: composer
233222
coverage: none
234223

composer.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@
2727
}
2828
},
2929
"require": {
30-
"php": "^8.1",
30+
"php": "^8.3",
31+
3132
"ext-posix": "*",
3233
"ext-sockets": "*",
3334

34-
"simplesamlphp/assert": "~1.8.1",
35-
"simplesamlphp/composer-module-installer": "~1.4.0",
36-
"simplesamlphp/saml2-legacy": "~4.19.1",
37-
"simplesamlphp/simplesamlphp": "~2.4.0"
35+
"simplesamlphp/assert": "^1.9",
36+
"simplesamlphp/composer-module-installer": "^1.5",
37+
"simplesamlphp/saml2-legacy": "^4.19",
38+
"simplesamlphp/simplesamlphp": "^2.5@dev"
3839
},
3940
"require-dev": {
40-
"simplesamlphp/simplesamlphp-test-framework": "~1.9.2"
41+
"simplesamlphp/simplesamlphp-test-framework": "^1.11"
4142
},
4243
"autoload": {
4344
"psr-4": {

phpstan-dev.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- tests

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 6
3+
paths:
4+
- src

src/Auth/Process/Fticks.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Fticks extends Auth\ProcessingFilter
6262
/** @var string The logging backend */
6363
private string $logdest = 'simplesamlphp';
6464

65-
/** @var array Backend specific logging config */
65+
/** @var array<mixed> Backend specific logging config */
6666
private array $logconfig = [];
6767

6868
/** @var string The username attribute to use */
@@ -74,7 +74,7 @@ class Fticks extends Auth\ProcessingFilter
7474
/** @var string The hashing algorithm to use */
7575
private string $algorithm = 'sha256';
7676

77-
/** @var array F-ticks attributes to exclude */
77+
/** @var array<mixed> F-ticks attributes to exclude */
7878
private array $exclude = [];
7979

8080
/** @var string Enable legacy handing of PN (for backwards compatibility) */
@@ -151,7 +151,7 @@ private function log(string $msg): void
151151
/**
152152
* Generate a PN hash
153153
*
154-
* @param array $state
154+
* @param array<mixed> $state
155155
* @return string|null $hash
156156
*/
157157
private function generatePNhash(array &$state): ?string
@@ -209,7 +209,7 @@ private function escapeFticks(string $value): string
209209
/**
210210
* Initialize this filter, parse configuration.
211211
*
212-
* @param array $config Configuration information about this filter.
212+
* @param array<mixed> $config Configuration information about this filter.
213213
* @param mixed $reserved For future use.
214214
* @throws \SimpleSAML\Error\Exception
215215
*/
@@ -345,7 +345,7 @@ private function warnRiskyLogSettings(int $defaultFacility, string $defaultProce
345345
/**
346346
* Process this filter
347347
*
348-
* @param mixed &$state
348+
* @param array<mixed> &$state
349349
*/
350350
public function process(array &$state): void
351351
{
@@ -427,9 +427,6 @@ public function process(array &$state): void
427427

428428
/**
429429
* Callback method to filter excluded attributes
430-
*
431-
* @param string $attr
432-
* @return bool
433430
*/
434431
private function filterExcludedAttributes(string $attr): bool
435432
{
@@ -440,20 +437,16 @@ private function filterExcludedAttributes(string $attr): bool
440437
/**
441438
* Assemble fticks log string
442439
*
443-
* @param array $fticks
444-
* @return string
440+
* @param array<mixed> $fticks
445441
*/
446442
private function assembleFticksLogString(array $fticks): string
447443
{
448444
$attributes = implode(
449445
'#',
450446
array_map(
451447
/**
452-
* @param string $k
453-
* @param string $v
454-
* @return string
455448
*/
456-
function ($k, $v) {
449+
function (string $k, string $v): string {
457450
return $k . '=' . $this->escapeFticks(strval($v));
458451
},
459452
array_keys($fticks),

tests/src/Auth/Process/FticksTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ public function testFilteringString(): void
407407
$this->assertEquals($request, $result);
408408
}
409409

410+
410411
/**
411412
*/
412413
public function testInvalidConfig(): void

0 commit comments

Comments
 (0)