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
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Lint markdown files
uses: nosborn/github-action-markdown-cli@v3
Expand Down
36 changes: 11 additions & 25 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf

- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Get composer cache directory
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -117,7 +117,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
Expand All @@ -133,7 +133,7 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf

- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Get composer cache directory
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Get composer cache directory
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -201,27 +201,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

- 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

security:
name: Security checks
Expand All @@ -242,7 +228,7 @@ jobs:
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Get composer cache directory
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -272,9 +258,9 @@ jobs:
needs: [unit-tests-linux]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v5
with:
name: coverage-data
path: ${{ github.workspace }}/build
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: 5
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.

36 changes: 0 additions & 36 deletions psalm.xml

This file was deleted.

32 changes: 14 additions & 18 deletions src/PowerIdPDisco.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ class PowerIdPDisco extends IdPDisco
/**
* The default sort weight for entries without 'discopower.weight'.
*
* @var int|null
* @var int
*/
private static ?int $defaultWeight = 100;
private static int $defaultWeight = 100;

/**
* Initializes this discovery service.
*
* The constructor does the parsing of the request. If this is an invalid request, it will throw an exception.
*
* @param array $metadataSets Array with metadata sets we find remote entities in.
* @param array<mixed> $metadataSets Array with metadata sets we find remote entities in.
* @param string $instance The name of this instance of the discovery service.
*/
public function __construct(array $metadataSets, string $instance)
Expand Down Expand Up @@ -102,8 +102,8 @@ protected function log(string $message): void
* higher, and will always put IdP's with names configured before those with
* only an entityID.
*
* @param array $a The metadata of the first entity.
* @param array $b The metadata of the second entity.
* @param array<mixed> $a The metadata of the first entity.
* @param array<mixed> $b The metadata of the second entity.
*
* @return int How $a compares to $b.
*/
Expand Down Expand Up @@ -135,9 +135,9 @@ public static function mcmp(array $a, array $b): int
/**
* Structure the list of IdPs in a hierarchy based upon the tags.
*
* @param array $list A list of IdPs.
* @param array<mixed> $list A list of IdPs.
*
* @return array The list of IdPs structured accordingly.
* @return array<mixed> The list of IdPs structured accordingly.
*/
protected function idplistStructured(array $list): array
{
Expand Down Expand Up @@ -178,8 +178,8 @@ protected function idplistStructured(array $list): array
/**
* Do the actual filtering according the rules defined.
*
* @param array $filter A set of rules regarding filtering.
* @param array $entry An entry to be evaluated by the filters.
* @param array<mixed> $filter A set of rules regarding filtering.
* @param array<mixed> $entry An entry to be evaluated by the filters.
* @param boolean $default What to do in case the entity does not match any rules. Defaults to true.
*
* @return boolean True if the entity should be kept, false if it should be discarded according to the filters.
Expand Down Expand Up @@ -213,9 +213,9 @@ private function processFilter(array $filter, array $entry, bool $default = true
* Filter a list of entities according to any filters defined in the parent class, plus discopower configuration
* options regarding filtering.
*
* @param array $list A list of entities to filter.
* @param array<mixed> $list A list of entities to filter.
*
* @return array The list in $list after filtering entities.
* @return array<mixed> The list in $list after filtering entities.
*/
protected function filterList(array $list): array
{
Expand Down Expand Up @@ -358,8 +358,8 @@ public function handleRequest(): void

/**
* @param \SimpleSAML\XHTML\Template $t
* @param array $metadata
* @return array
* @param array<mixed> $metadata
* @return array<mixed>
*/
private function processMetadata(Template $t, array $metadata): array
{
Expand Down Expand Up @@ -389,7 +389,7 @@ private function processMetadata(Template $t, array $metadata): array
/**
* Get the IdP entities saved in the common domain cookie.
*
* @return array List of IdP entities.
* @return string[] List of IdP entities.
*/
private function getCDC(): array
{
Expand All @@ -401,10 +401,6 @@ private function getCDC(): array
$ret = explode(' ', $ret);
foreach ($ret as &$idp) {
$idp = base64_decode($idp);
if ($idp === false) {
// not properly base64 encoded
return [];
}
}

return $ret;
Expand Down
Loading