Skip to content

Commit 1cf2f8e

Browse files
authored
Update deprecated GH actions (#105)
* Update deprecated GH actions * Speed up Psalm * Fix implicit nullable * Fix mock claims * Fix one more implicit nullable * Fix tenant ID * Update one more GH action * Remove deprecated MixedInferredReturnType
1 parent 0f666b0 commit 1cf2f8e

File tree

5 files changed

+35
-29
lines changed

5 files changed

+35
-29
lines changed

.github/workflows/php.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
operating-system: [ubuntu-latest]
17-
php-versions: ['8.1', '8.2', '8.3']
17+
php-versions: ['8.1', '8.2', '8.3', '8.4']
1818

1919
steps:
2020
- name: Setup PHP, with composer and extensions
@@ -37,14 +37,14 @@ jobs:
3737
git config --global core.autocrlf false
3838
git config --global core.eol lf
3939
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141

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

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

5959
- name: Decide whether to run code coverage or not
60-
if: ${{ matrix.php-versions != '8.2' || matrix.operating-system != 'ubuntu-latest' }}
60+
if: ${{ matrix.php-versions != '8.4' || matrix.operating-system != 'ubuntu-latest' }}
6161
run: |
6262
echo "NO_COVERAGE=--no-coverage" >> $GITHUB_ENV
6363
@@ -67,20 +67,20 @@ jobs:
6767
./vendor/bin/phpunit $NO_COVERAGE
6868
6969
- name: Save coverage data
70-
if: ${{ matrix.php-versions == '8.2' && matrix.operating-system == 'ubuntu-latest' }}
71-
uses: actions/upload-artifact@v3
70+
if: ${{ matrix.php-versions == '8.4' && matrix.operating-system == 'ubuntu-latest' }}
71+
uses: actions/upload-artifact@v4
7272
with:
7373
name: build-data
7474
path: ${{ github.workspace }}/build
7575

7676
- name: List files in the workspace
77-
if: ${{ matrix.php-versions == '8.2' && matrix.operating-system == 'ubuntu-latest' }}
77+
if: ${{ matrix.php-versions == '8.4' && matrix.operating-system == 'ubuntu-latest' }}
7878
run: |
7979
ls -la ${{ github.workspace }}/build
8080
ls -la ${{ github.workspace }}/build/logs
8181
8282
- name: Code Coverage Report
83-
if: ${{ matrix.php-versions == '8.2' && matrix.operating-system == 'ubuntu-latest' }}
83+
if: ${{ matrix.php-versions == '8.4' && matrix.operating-system == 'ubuntu-latest' }}
8484
uses: irongut/[email protected]
8585
with:
8686
filename: build/logs/cobertura.xml
@@ -100,22 +100,23 @@ jobs:
100100
- name: Setup PHP, with composer and extensions
101101
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
102102
with:
103-
php-version: '8.2'
103+
# Should be the lowest supported version
104+
php-version: '8.1'
104105
extensions: mbstring, xml
105106
tools: composer:v2
106107
coverage: none
107108

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

111-
- uses: actions/checkout@v3
112+
- uses: actions/checkout@v4
112113

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

117118
- name: Cache composer dependencies
118-
uses: actions/cache@v3
119+
uses: actions/cache@v4
119120
with:
120121
path: ${{ steps.composer-cache.outputs.dir }}
121122
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -143,21 +144,23 @@ jobs:
143144
id: setup-php
144145
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
145146
with:
146-
php-version: '8.2'
147+
# Should be the higest supported version, so we can use the newest tools
148+
php-version: '8.4'
147149
tools: composer:v2
148-
extensions: mbstring, xml
150+
# optional performance gain for psalm: opcache
151+
extensions: mbstring, opcache, xml
149152

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

153-
- uses: actions/checkout@v3
156+
- uses: actions/checkout@v4
154157

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

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

169-
- uses: actions/download-artifact@v3
172+
- uses: actions/download-artifact@v4
170173
with:
171174
name: build-data
172175
path: ${{ github.workspace }}/build

psalm.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<MixedArrayAccess errorLevel="suppress" />
3737
<MixedReturnTypeCoercion errorLevel="suppress" />
3838
<MixedReturnStatement errorLevel="suppress" />
39-
<MixedInferredReturnType errorLevel="suppress" />
4039
<MixedAssignment errorLevel="suppress" />
4140

4241
<!-- Ignore errors related to unused classes, methods... -->

src/Controller/ErrorController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ErrorController
2323
*
2424
* @throws \Exception
2525
*/
26-
public function __construct(Configuration $config = null)
26+
public function __construct(?Configuration $config = null)
2727
{
2828
$this->config = $config ?? Configuration::getInstance();
2929
}

src/Controller/OIDCLogoutController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class OIDCLogoutController
4646
*
4747
* @throws \Exception
4848
*/
49-
public function __construct(Configuration $config = null)
49+
public function __construct(?Configuration $config = null)
5050
{
5151
$this->config = $config ?? Configuration::getInstance();
5252
}

tests/lib/Auth/Source/MicrosoftHybridAuthTest.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,22 @@ public static function combineOidcAndGraphProfileProvider(): array
119119
'[email protected]' => ['https://graph.microsoft.com/v1.0/$metadata#directoryObjects'],
120120
'[email protected]' => ['#microsoft.graph.group'],
121121
'microsoft.value.0.id' => ['11111111-1111-1111-1111-111111111111'],
122-
]
122+
'microsoft.tid' => ['9188040d-6c67-4c5b-b11236a304b66dad'],
123+
],
123124
],
124-
[$validIdToken, $conflictedRequestAttributes, [
125-
'microsoft.name' => ['Steve Stratus'],
126-
'microsoft.mail' => ['[email protected]'],
127-
'microsoft.id' => ['11111111'],
128-
'[email protected]' => ['https://graph.microsoft.com/v1.0/$metadata#directoryObjects'],
129-
'[email protected]' => ['#microsoft.graph.group'],
130-
'microsoft.value.0.id' => ['11111111-1111-1111-1111-111111111111'],
131-
]
125+
[
126+
$validIdToken,
127+
$conflictedRequestAttributes,
128+
[
129+
'microsoft.name' => ['Steve Stratus'],
130+
'microsoft.mail' => ['[email protected]'],
131+
'microsoft.id' => ['11111111'],
132+
'[email protected]' => ['https://graph.microsoft.com/v1.0/$metadata#directoryObjects'],
133+
'[email protected]' => ['#microsoft.graph.group'],
134+
'microsoft.value.0.id' => ['11111111-1111-1111-1111-111111111111'],
135+
'microsoft.tid' => ['9188040d-6c67-4c5b-b11236a304b66dad'],
136+
],
132137
],
133-
134138
];
135139
}
136140
}

0 commit comments

Comments
 (0)