From e22b8fdd28c54e608402aace2492e72f49ea0c9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 19:07:29 +0000 Subject: [PATCH 1/4] Bump simplesamlphp/simplesamlphp-test-framework in the all-actions group Bumps the all-actions group with 1 update: [simplesamlphp/simplesamlphp-test-framework](https://github.com/simplesamlphp/simplesamlphp-test-framework). Updates `simplesamlphp/simplesamlphp-test-framework` from 1.10.0 to 1.10.1 - [Commits](https://github.com/simplesamlphp/simplesamlphp-test-framework/compare/v1.10.0...v1.10.1) --- updated-dependencies: - dependency-name: simplesamlphp/simplesamlphp-test-framework dependency-version: 1.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 7db50bd..47d5b85 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,7 +21,7 @@ jobs: matrix: php-version: ['8.1', '8.2', '8.3', '8.4'] - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.0 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.1 with: php-version: ${{ matrix.php-version }} @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false - uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.0 + uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.10.1 with: enable_eslinter: false enable_jsonlinter: true From a19640a7b4bedc3c0680000e2deb0bd0da179c18 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 5 Oct 2025 16:54:56 +0200 Subject: [PATCH 2/4] Fix CI: add zip-extension for windows-build and use internal phpcs --- .github/workflows/php.yml | 6 +++--- phpcs.xml | 11 +++++++++++ tests/src/Controller/DebugTest.php | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 47d5b85..cbb9e08 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -115,7 +115,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-versions }} - extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml + extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml, zip tools: composer ini-values: error_reporting=E_ALL coverage: none @@ -161,7 +161,7 @@ jobs: with: # Should be the higest supported version, so we can use the newest tools php-version: '8.4' - tools: composer, composer-require-checker, composer-unused, phpcs, psalm + tools: composer, composer-require-checker, composer-unused, psalm # optional performance gain for psalm: opcache extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, pcre, posix, spl, xml @@ -193,7 +193,7 @@ jobs: run: composer-unused - name: PHP Code Sniffer - run: phpcs + run: vendor/bin/phpcs - name: Psalm continue-on-error: true diff --git a/phpcs.xml b/phpcs.xml index bae358b..a83fd44 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -12,6 +12,17 @@ templates tests + + + + + + + + + tests/src/Controller/DebugTest.php + + diff --git a/tests/src/Controller/DebugTest.php b/tests/src/Controller/DebugTest.php index 048d2c6..2ab02aa 100644 --- a/tests/src/Controller/DebugTest.php +++ b/tests/src/Controller/DebugTest.php @@ -28,6 +28,7 @@ final class DebugTest extends TestCase /** @var string */ protected static string $encoded = 'SAMLRequest=pVJNjxMxDP0ro9yn88FOtRu1lcpWiEoLVNvCgQtKE6eNlHGG2IHl35OZLmLZQy%2BcrNh%2Bz88vXpDq%2FSDXic%2F4CN8TEBdPvUeSU2EpUkQZFDmSqHogyVru1x8eZDur5RADBx28eAG5jlBEENkFFMV2sxTfzO0dmKa11namPuoc39hba%2BfqpqlbM6%2Fb5mZ%2B1LWtj6L4ApEycikyUYYTJdgisULOqbrpyqYt67tD28iulV33VRSbvI1DxRPqzDyQrCrAk0OYUYpWB4QnnqGvVN4fkJ2emitnhoocnjyU5E5YjnrXf6TfB6TUQ9xD%2FOE0fH58%2BEueHbHOv2Yn1w8eRneqPpiU68M5DxjfdIltqTRNWQNWJc8lDaLYPfv71qHJaq5be7w0kXx%2FOOzK3af9QawWI7ecrIqr%2F9HYAyujWL2SuKheDlhcbuljlrbd7IJ3%2BlfxLsRe8XXlY8aZ0k6tkqNCcvkzsuXeh5%2F3ERTDUnBMIKrVZeS%2FF7v6DQ%3D%3D'; + /** * Set up for each test. */ From eccd1bbbfd58f38d41226a1cf7c6ea7332b29217 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 5 Oct 2025 17:19:33 +0200 Subject: [PATCH 3/4] Bump minimum PHP-version to 8.2 and bump test-framework --- .github/workflows/php.yml | 8 ++++---- composer.json | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index cbb9e08..c4e5d2b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.1', '8.2', '8.3', '8.4'] + php-version: ['8.2', '8.3', '8.4'] uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.1 with: @@ -45,7 +45,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.2', '8.3', '8.4'] steps: - name: Setup PHP, with composer and extensions @@ -107,7 +107,7 @@ jobs: fail-fast: true matrix: operating-system: [windows-latest] - php-versions: ['8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.2', '8.3', '8.4'] steps: - name: Setup PHP, with composer and extensions @@ -226,7 +226,7 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the lowest supported version - php-version: '8.1' + php-version: '8.2' extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, openssl, pcre, posix, spl, xml tools: composer coverage: none diff --git a/composer.json b/composer.json index 39e3572..9270a65 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,14 @@ } }, "require": { - "php": "^8.1", + "php": "^8.2", "ext-zlib": "*", - "simplesamlphp/simplesamlphp": "^2.2.0", + "simplesamlphp/simplesamlphp": "^2.4.0", "symfony/http-foundation": "^6.4.0" }, "require-dev": { - "simplesamlphp/simplesamlphp-test-framework": "^1.7.0" + "simplesamlphp/simplesamlphp-test-framework": "^1.10.2" }, "config": { "allow-plugins": { From c2fcd8b07bdeb16c30bdb7502a9ad12e4221dd99 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sun, 5 Oct 2025 17:22:21 +0200 Subject: [PATCH 4/4] Replace psalm with phpstan --- .github/workflows/php.yml | 27 ++++++--------------------- phpstan-dev.neon | 4 ++++ phpstan.neon | 4 ++++ psalm-dev.xml | 18 ------------------ psalm.xml | 30 ------------------------------ src/Controller/Debug.php | 4 ++-- 6 files changed, 16 insertions(+), 71 deletions(-) create mode 100644 phpstan-dev.neon create mode 100644 phpstan.neon delete mode 100644 psalm-dev.xml delete mode 100644 psalm.xml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c4e5d2b..8ffa2dd 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -161,9 +161,8 @@ jobs: with: # Should be the higest supported version, so we can use the newest tools php-version: '8.4' - tools: composer, composer-require-checker, composer-unused, psalm - # optional performance gain for psalm: opcache - extensions: ctype, date, dom, fileinfo, filter, hash, intl, mbstring, opcache, openssl, pcre, posix, spl, xml + tools: composer, composer-require-checker, composer-unused + 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" @@ -195,27 +194,13 @@ jobs: - name: PHP Code Sniffer run: vendor/bin/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 diff --git a/phpstan-dev.neon b/phpstan-dev.neon new file mode 100644 index 0000000..4d29b8b --- /dev/null +++ b/phpstan-dev.neon @@ -0,0 +1,4 @@ +parameters: + level: 9 + paths: + - tests diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..db37782 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,4 @@ +parameters: + level: 6 + paths: + - src diff --git a/psalm-dev.xml b/psalm-dev.xml deleted file mode 100644 index 95c5632..0000000 --- a/psalm-dev.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index ba38ecb..0000000 --- a/psalm.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Controller/Debug.php b/src/Controller/Debug.php index b3e9479..873e389 100644 --- a/src/Controller/Debug.php +++ b/src/Controller/Debug.php @@ -107,9 +107,9 @@ public function encode(Request $request): Template /** * @param string $raw - * @return string + * @return string[]|string */ - private function getValue(string $raw): string + private function getValue(string $raw): array|string { $val = $raw;