Skip to content

Commit 2d54e18

Browse files
committed
Start testing PHP 8.4
1 parent 15562c0 commit 2d54e18

7 files changed

Lines changed: 29 additions & 93 deletions

File tree

.github/workflows/php.yml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ jobs:
5353
uses: shivammathur/setup-php@v2
5454
with:
5555
# Should be the higest supported version, so we can use the newest tools
56-
php-version: '8.3'
57-
tools: composer, composer-require-checker, composer-unused, phpcs, psalm
58-
# optional performance gain for psalm: opcache
59-
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, pcre, posix, spl, xml
56+
php-version: '8.4'
57+
tools: composer, composer-require-checker, composer-unused, phpcs, phpstan
58+
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml
6059

6160
- name: Setup problem matchers for PHP
6261
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
@@ -88,27 +87,13 @@ jobs:
8887
- name: PHP Code Sniffer
8988
run: phpcs
9089

91-
- name: Psalm
92-
continue-on-error: true
93-
run: |
94-
psalm -c psalm.xml \
95-
--show-info=true \
96-
--shepherd \
97-
--php-version=${{ steps.setup-php.outputs.php-version }}
98-
99-
- name: Psalm (testsuite)
90+
- name: PHPStan
10091
run: |
101-
psalm -c psalm-dev.xml \
102-
--show-info=true \
103-
--shepherd \
104-
--php-version=${{ steps.setup-php.outputs.php-version }}
92+
vendor/bin/phpstan analyze -c phpstan.neon --debug
10593
106-
- name: Psalter
94+
- name: PHPStan (testsuite)
10795
run: |
108-
psalm --alter \
109-
--issues=UnnecessaryVarAnnotation \
110-
--dry-run \
111-
--php-version=${{ steps.setup-php.outputs.php-version }}
96+
vendor/bin/phpstan analyze -c phpstan-dev.neon --debug
11297
11398
security:
11499
name: Security checks
@@ -159,7 +144,7 @@ jobs:
159144
fail-fast: false
160145
matrix:
161146
operating-system: [ubuntu-latest]
162-
php-versions: ['8.1', '8.2', '8.3']
147+
php-versions: ['8.1', '8.2', '8.3', '8.4']
163148

164149
steps:
165150
- name: Setup PHP, with composer and extensions
@@ -199,15 +184,15 @@ jobs:
199184
run: composer install --no-progress --prefer-dist --optimize-autoloader
200185

201186
- name: Run unit tests with coverage
202-
if: ${{ matrix.php-versions == '8.3' }}
187+
if: ${{ matrix.php-versions == '8.4' }}
203188
run: vendor/bin/phpunit
204189

205190
- name: Run unit tests (no coverage)
206-
if: ${{ matrix.php-versions != '8.3' }}
191+
if: ${{ matrix.php-versions != '8.4' }}
207192
run: vendor/bin/phpunit --no-coverage
208193

209194
- name: Save coverage data
210-
if: ${{ matrix.php-versions == '8.3' }}
195+
if: ${{ matrix.php-versions == '8.4' }}
211196
uses: actions/upload-artifact@v4
212197
with:
213198
name: coverage-data
@@ -221,7 +206,7 @@ jobs:
221206
fail-fast: true
222207
matrix:
223208
operating-system: [windows-latest]
224-
php-versions: ['8.1', '8.2', '8.3']
209+
php-versions: ['8.1', '8.2', '8.3', '8.4']
225210

226211
steps:
227212
- name: Setup PHP, with composer and extensions

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: 9
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

psalm-dev.xml

Lines changed: 0 additions & 27 deletions
This file was deleted.

psalm.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/Auth/Source/Hash.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ class Hash extends UserPassBase
2626
* Our users, stored in an associative array. The key of the array is "<username>:<passwordhash>",
2727
* while the value of each element is a new array with the attributes for each user.
2828
*
29-
* @var array
29+
* @var array<string, mixed>
3030
*/
3131
private array $users;
3232

3333

3434
/**
3535
* Constructor for this authentication source.
3636
*
37-
* @param array $info Information about this authentication source.
38-
* @param array $config Configuration.
37+
* @param array<string, mixed> $info Information about this authentication source.
38+
* @param array<string, mixed> $config Configuration.
3939
*
4040
* @throws \Exception in case of a configuration error.
4141
*/
@@ -87,7 +87,7 @@ public function __construct(array $info, array $config)
8787
* @param string $username The username the user wrote.
8888
* @param string $password The password the user wrote.
8989
*
90-
* @return array Associative array with the users attributes.
90+
* @return array<string, mixed> Associative array with the users attributes.
9191
*
9292
* @throws \SimpleSAML\Error\Error if authentication fails.
9393
*/

src/Auth/Source/Htpasswd.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ class Htpasswd extends UserPassBase
2626
/**
2727
* Our users, stored in an array, where each value is "<username>:<passwordhash>".
2828
*
29-
* @var array
29+
* @var array<int, mixed>
3030
*/
3131
private array $users;
3232

3333
/**
3434
* An array containing static attributes for our users.
3535
*
36-
* @var array
36+
* @var array<string, mixed>
3737
*/
3838
private array $attributes = [];
3939

4040

4141
/**
4242
* Constructor for this authentication source.
4343
*
44-
* @param array $info Information about this authentication source.
45-
* @param array $config Configuration.
44+
* @param array<string, mixed> $info Information about this authentication source.
45+
* @param array<string, mixed> $config Configuration.
4646
*
4747
* @throws \Exception if the htpasswd file is not readable or the static_attributes array is invalid.
4848
*/
@@ -81,7 +81,7 @@ public function __construct(array $info, array $config)
8181
* @param string $username The username the user wrote.
8282
* @param string $password The password the user wrote.
8383
*
84-
* @return array Associative array with the users attributes.
84+
* @return array<string, mixed> Associative array with the users attributes.
8585
*
8686
* @throws \SimpleSAML\Error\Error if authentication fails.
8787
*/

0 commit comments

Comments
 (0)