Skip to content

Commit

Permalink
Start testing PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Dec 2, 2024
1 parent 15562c0 commit 2d54e18
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 93 deletions.
39 changes: 12 additions & 27 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.3'
tools: composer, composer-require-checker, composer-unused, phpcs, psalm
# optional performance gain for psalm: opcache
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, pcre, posix, spl, xml
php-version: '8.4'
tools: composer, composer-require-checker, composer-unused, phpcs, phpstan
extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml

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

- name: Psalm
continue-on-error: true
run: |
psalm -c psalm.xml \
--show-info=true \
--shepherd \
--php-version=${{ steps.setup-php.outputs.php-version }}
- name: Psalm (testsuite)
- name: PHPStan
run: |
psalm -c psalm-dev.xml \
--show-info=true \
--shepherd \
--php-version=${{ steps.setup-php.outputs.php-version }}
vendor/bin/phpstan analyze -c phpstan.neon --debug
- name: Psalter
- name: PHPStan (testsuite)
run: |
psalm --alter \
--issues=UnnecessaryVarAnnotation \
--dry-run \
--php-version=${{ steps.setup-php.outputs.php-version }}
vendor/bin/phpstan analyze -c phpstan-dev.neon --debug
security:
name: Security checks
Expand Down Expand Up @@ -159,7 +144,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Setup PHP, with composer and extensions
Expand Down Expand Up @@ -199,15 +184,15 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

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

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

- name: Save coverage data
if: ${{ matrix.php-versions == '8.3' }}
if: ${{ matrix.php-versions == '8.4' }}
uses: actions/upload-artifact@v4
with:
name: coverage-data
Expand All @@ -221,7 +206,7 @@ jobs:
fail-fast: true
matrix:
operating-system: [windows-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Setup PHP, with composer and extensions
Expand Down
4 changes: 4 additions & 0 deletions phpstan-dev.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: 9
paths:
- tests
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: 6
paths:
- src
27 changes: 0 additions & 27 deletions psalm-dev.xml

This file was deleted.

30 changes: 0 additions & 30 deletions psalm.xml

This file was deleted.

8 changes: 4 additions & 4 deletions src/Auth/Source/Hash.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ class Hash extends UserPassBase
* Our users, stored in an associative array. The key of the array is "<username>:<passwordhash>",
* while the value of each element is a new array with the attributes for each user.
*
* @var array
* @var array<string, mixed>
*/
private array $users;


/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
* @param array<string, mixed> $info Information about this authentication source.
* @param array<string, mixed> $config Configuration.
*
* @throws \Exception in case of a configuration error.
*/
Expand Down Expand Up @@ -87,7 +87,7 @@ public function __construct(array $info, array $config)
* @param string $username The username the user wrote.
* @param string $password The password the user wrote.
*
* @return array Associative array with the users attributes.
* @return array<string, mixed> Associative array with the users attributes.
*
* @throws \SimpleSAML\Error\Error if authentication fails.
*/
Expand Down
10 changes: 5 additions & 5 deletions src/Auth/Source/Htpasswd.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ class Htpasswd extends UserPassBase
/**
* Our users, stored in an array, where each value is "<username>:<passwordhash>".
*
* @var array
* @var array<int, mixed>
*/
private array $users;

/**
* An array containing static attributes for our users.
*
* @var array
* @var array<string, mixed>
*/
private array $attributes = [];


/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
* @param array<string, mixed> $info Information about this authentication source.
* @param array<string, mixed> $config Configuration.
*
* @throws \Exception if the htpasswd file is not readable or the static_attributes array is invalid.
*/
Expand Down Expand Up @@ -81,7 +81,7 @@ public function __construct(array $info, array $config)
* @param string $username The username the user wrote.
* @param string $password The password the user wrote.
*
* @return array Associative array with the users attributes.
* @return array<string, mixed> Associative array with the users attributes.
*
* @throws \SimpleSAML\Error\Error if authentication fails.
*/
Expand Down

0 comments on commit 2d54e18

Please sign in to comment.