Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 14 additions & 29 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ 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.0
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.10.1
with:
php-version: ${{ matrix.php-version }}

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -107,15 +107,15 @@ 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
# https://github.com/shivammathur/setup-php
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
Expand Down Expand Up @@ -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, phpcs, 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"
Expand Down Expand Up @@ -193,29 +192,15 @@ jobs:
run: composer-unused

- 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 }}
run: vendor/bin/phpcs

- 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 All @@ -226,7 +211,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
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
11 changes: 11 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
<file>templates</file>
<file>tests</file>

<!-- Lines can be a little bit longer before they break the build -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="130"/>
</properties>

<!-- Exclude files with long lines that we cannot immediately fix -->
<exclude-pattern>tests/src/Controller/DebugTest.php</exclude-pattern>
</rule>

<!-- Use this to exclude paths. You can have multiple patterns -->
<!--<exclude-pattern>*/tests/*</exclude-pattern>-->
<!--<exclude-pattern>*/other/*</exclude-pattern>-->
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
18 changes: 0 additions & 18 deletions psalm-dev.xml

This file was deleted.

30 changes: 0 additions & 30 deletions psalm.xml

This file was deleted.

4 changes: 2 additions & 2 deletions src/Controller/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions tests/src/Controller/DebugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down