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
35 changes: 19 additions & 16 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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 All @@ -37,14 +37,14 @@ jobs:
git config --global core.autocrlf false
git config --global core.eol lf

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

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -57,7 +57,7 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Decide whether to run code coverage or not
if: ${{ matrix.php-versions != '8.2' || matrix.operating-system != 'ubuntu-latest' }}
if: ${{ matrix.php-versions != '8.4' || matrix.operating-system != 'ubuntu-latest' }}
run: |
echo "NO_COVERAGE=--no-coverage" >> $GITHUB_ENV

Expand All @@ -67,20 +67,20 @@ jobs:
./vendor/bin/phpunit $NO_COVERAGE

- name: Save coverage data
if: ${{ matrix.php-versions == '8.2' && matrix.operating-system == 'ubuntu-latest' }}
uses: actions/upload-artifact@v3
if: ${{ matrix.php-versions == '8.4' && matrix.operating-system == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with:
name: build-data
path: ${{ github.workspace }}/build

- name: List files in the workspace
if: ${{ matrix.php-versions == '8.2' && matrix.operating-system == 'ubuntu-latest' }}
if: ${{ matrix.php-versions == '8.4' && matrix.operating-system == 'ubuntu-latest' }}
run: |
ls -la ${{ github.workspace }}/build
ls -la ${{ github.workspace }}/build/logs

- name: Code Coverage Report
if: ${{ matrix.php-versions == '8.2' && matrix.operating-system == 'ubuntu-latest' }}
if: ${{ matrix.php-versions == '8.4' && matrix.operating-system == 'ubuntu-latest' }}
uses: irongut/[email protected]
with:
filename: build/logs/cobertura.xml
Expand All @@ -100,22 +100,23 @@ jobs:
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: '8.2'
# Should be the lowest supported version
php-version: '8.1'
extensions: mbstring, xml
tools: composer:v2
coverage: none

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

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

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down Expand Up @@ -143,21 +144,23 @@ jobs:
id: setup-php
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: '8.2'
# Should be the higest supported version, so we can use the newest tools
php-version: '8.4'
tools: composer:v2
extensions: mbstring, xml
# optional performance gain for psalm: opcache
extensions: mbstring, opcache, xml

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

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

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -166,7 +169,7 @@ jobs:
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build-data
path: ${{ github.workspace }}/build
Expand Down
1 change: 0 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<MixedArrayAccess errorLevel="suppress" />
<MixedReturnTypeCoercion errorLevel="suppress" />
<MixedReturnStatement errorLevel="suppress" />
<MixedInferredReturnType errorLevel="suppress" />
<MixedAssignment errorLevel="suppress" />

<!-- Ignore errors related to unused classes, methods... -->
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ErrorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ErrorController
*
* @throws \Exception
*/
public function __construct(Configuration $config = null)
public function __construct(?Configuration $config = null)
{
$this->config = $config ?? Configuration::getInstance();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/OIDCLogoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use SimpleSAML\Module\authoauth2\locators\SourceServiceLocator;
use Symfony\Component\HttpFoundation\Request;

class OIDCLogoutController

Check warning on line 21 in src/Controller/OIDCLogoutController.php

View workflow job for this annotation

GitHub Actions / Quality control

PropertyNotSetInConstructor

src/Controller/OIDCLogoutController.php:21:7: PropertyNotSetInConstructor: Property SimpleSAML\Module\authoauth2\Controller\OIDCLogoutController::$sourceId is not defined in constructor of SimpleSAML\Module\authoauth2\Controller\OIDCLogoutController or in any methods called in the constructor (see https://psalm.dev/074)

Check warning on line 21 in src/Controller/OIDCLogoutController.php

View workflow job for this annotation

GitHub Actions / Quality control

PropertyNotSetInConstructor

src/Controller/OIDCLogoutController.php:21:7: PropertyNotSetInConstructor: Property SimpleSAML\Module\authoauth2\Controller\OIDCLogoutController::$source is not defined in constructor of SimpleSAML\Module\authoauth2\Controller\OIDCLogoutController or in any methods called in the constructor (see https://psalm.dev/074)

Check warning on line 21 in src/Controller/OIDCLogoutController.php

View workflow job for this annotation

GitHub Actions / Quality control

PropertyNotSetInConstructor

src/Controller/OIDCLogoutController.php:21:7: PropertyNotSetInConstructor: Property SimpleSAML\Module\authoauth2\Controller\OIDCLogoutController::$state is not defined in constructor of SimpleSAML\Module\authoauth2\Controller\OIDCLogoutController or in any methods called in the constructor (see https://psalm.dev/074)
{
use SourceServiceLocator;
use RequestTrait;
Expand Down Expand Up @@ -46,7 +46,7 @@
*
* @throws \Exception
*/
public function __construct(Configuration $config = null)
public function __construct(?Configuration $config = null)
{
$this->config = $config ?? Configuration::getInstance();
}
Expand Down
24 changes: 14 additions & 10 deletions tests/lib/Auth/Source/MicrosoftHybridAuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,22 @@ public static function combineOidcAndGraphProfileProvider(): array
'[email protected]' => ['https://graph.microsoft.com/v1.0/$metadata#directoryObjects'],
'[email protected]' => ['#microsoft.graph.group'],
'microsoft.value.0.id' => ['11111111-1111-1111-1111-111111111111'],
]
'microsoft.tid' => ['9188040d-6c67-4c5b-b11236a304b66dad'],
],
],
[$validIdToken, $conflictedRequestAttributes, [
'microsoft.name' => ['Steve Stratus'],
'microsoft.mail' => ['[email protected]'],
'microsoft.id' => ['11111111'],
'[email protected]' => ['https://graph.microsoft.com/v1.0/$metadata#directoryObjects'],
'[email protected]' => ['#microsoft.graph.group'],
'microsoft.value.0.id' => ['11111111-1111-1111-1111-111111111111'],
]
[
$validIdToken,
$conflictedRequestAttributes,
[
'microsoft.name' => ['Steve Stratus'],
'microsoft.mail' => ['[email protected]'],
'microsoft.id' => ['11111111'],
'[email protected]' => ['https://graph.microsoft.com/v1.0/$metadata#directoryObjects'],
'[email protected]' => ['#microsoft.graph.group'],
'microsoft.value.0.id' => ['11111111-1111-1111-1111-111111111111'],
'microsoft.tid' => ['9188040d-6c67-4c5b-b11236a304b66dad'],
],
],

];
}
}
Loading