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
41 changes: 13 additions & 28 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,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 @@ -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
Expand All @@ -131,7 +131,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 @@ -162,14 +162,13 @@ 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, 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"

- 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 All @@ -196,27 +195,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 @@ -237,7 +222,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 @@ -266,9 +251,9 @@ jobs:
runs-on: [ubuntu-latest]
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
31 changes: 31 additions & 0 deletions 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This is a combination of 2 commits.
# This is the 1st commit message:

#eplace psalm with phpstan

# This is the commit message #2:

Replace psalm with phpstan

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: Mon Aug 18 21:58:48 2025 +0200
#
# interactive rebase in progress; onto 1a4ff67
# Last commands done (5 commands done):
# pick 9e85746 Replace psalm with phpstan
# squash e07af03 Replace psalm with phpstan
# No commands remaining.
# You are currently rebasing branch 'feature/replace-psalm' on '1a4ff67'.
#
# Changes to be committed:
# modified: .github/workflows/php.yml
# new file: phpstan-dev.neon
# new file: phpstan.neon
# deleted: psalm-dev.xml
# deleted: psalm.xml
# modified: src/Client.php
# modified: src/Controller/CDC.php
# modified: src/Server.php
#
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.

31 changes: 0 additions & 31 deletions psalm.xml

This file was deleted.

4 changes: 2 additions & 2 deletions src/Auth/Process/CDC.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CDC extends Auth\ProcessingFilter
/**
* Initialize this filter.
*
* @param array $config Configuration information about this filter.
* @param array<mixed> $config Configuration information about this filter.
* @param mixed $reserved For future use.
*/
public function __construct(array $config, $reserved)
Expand All @@ -54,7 +54,7 @@ public function __construct(array $config, $reserved)
/**
* Redirect to page setting CDC.
*
* @param array &$state The request state.
* @param array<mixed> &$state The request state.
*/
public function process(array &$state): void
{
Expand Down
19 changes: 6 additions & 13 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@

class Client
{
/**
* Our CDC domain.
*
* @var string
*/
private string $domain;

/**
* The CDC server we send requests to.
*
* @var Server
* @var \SimpleSAML\Module\cdc\Server
*/
private Server $server;

Expand All @@ -32,17 +25,17 @@ class Client
*
* @param string $domain The domain we should query the server for.
*/
public function __construct(string $domain)
{
$this->domain = $domain;
public function __construct(
protected string $domain,
) {
$this->server = new Server($domain);
}


/**
* Receive a CDC response.
*
* @return array|null The response, or NULL if no response is received.
* @return array<mixed>|null The response, or NULL if no response is received.
*/
public function getResponse(): ?array
{
Expand All @@ -55,7 +48,7 @@ public function getResponse(): ?array
*
* @param string $returnTo The URL we should return to afterwards.
* @param string $op The operation we are performing.
* @param array $params Additional parameters.
* @param array<mixed> $params Additional parameters.
*/
public function sendRequest(string $returnTo, string $op, array $params = []): void
{
Expand Down
4 changes: 0 additions & 4 deletions src/Controller/CDC.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public function resume(Request $request): RunnableResponse
}

$state = Auth\State::loadState($response['id'], 'cdc:resume');
if (is_null($state)) {
throw new Error\NoState();
}

return new RunnableResponse([Auth\ProcessingChain::class, 'resumeProcessing'], [$state]);
}
}
Loading
Loading