Skip to content

Commit d3e7493

Browse files
committed
Merge branch '4.1.x' into 4.2.x
* 4.1.x: ci: make the mutation testing job run fix(core): bound the compact serializers' segment split ci: keep the console commands compatible with Symfony 7.0 ci: stop running the test matrix through castor ci: make the workflow install the dependencies it analyses test(bundle): repair the configuration assertions on current PHPUnit ci: make ECS, PHPStan and Rector run again on 4.1.x fix(composer): mirror the brick/math range in the library sub-package fix(composer): update brick/math version range to include 0.18 and 0.19 fix(bundle): alias the nested token services with their own class fix(bundle): align the web debug toolbar item with the Symfony core styles fix(core): correct the parameter types of the nested token builder # Conflicts: # .ci-tools/phpstan-baseline.neon # src/Library/Checker/HeaderCheckerManager.php # src/Library/KeyManagement/Analyzer/UsageAnalyzer.php
2 parents 7a0e08e + 5b5a723 commit d3e7493

70 files changed

Lines changed: 479 additions & 165 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci-tools/infection.json.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"source": {
33
"directories": [
4-
"src"
4+
"../src"
55
]
66
},
77
"timeout": 3,

.ci-tools/phpstan-baseline.neon

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4506,12 +4506,6 @@ parameters:
45064506
count: 2
45074507
path: ../src/Library/Encryption/JWEBuilder.php
45084508

4509-
-
4510-
rawMessage: 'Method Jose\Component\Encryption\JWEBuilder::addRecipient() has parameter $recipientHeader with no value type specified in iterable type array.'
4511-
identifier: missingType.iterableValue
4512-
count: 1
4513-
path: ../src/Library/Encryption/JWEBuilder.php
4514-
45154509
-
45164510
rawMessage: 'Method Jose\Component\Encryption\JWEBuilder::checkAndSetContentEncryptionAlgorithm() has parameter $completeHeader with no value type specified in iterable type array.'
45174511
identifier: missingType.iterableValue
@@ -4614,18 +4608,6 @@ parameters:
46144608
count: 1
46154609
path: ../src/Library/Encryption/JWEBuilder.php
46164610

4617-
-
4618-
rawMessage: 'Method Jose\Component\Encryption\JWEBuilder::withSharedHeader() has parameter $sharedHeader with no value type specified in iterable type array.'
4619-
identifier: missingType.iterableValue
4620-
count: 1
4621-
path: ../src/Library/Encryption/JWEBuilder.php
4622-
4623-
-
4624-
rawMessage: 'Method Jose\Component\Encryption\JWEBuilder::withSharedProtectedHeader() has parameter $sharedProtectedHeader with no value type specified in iterable type array.'
4625-
identifier: missingType.iterableValue
4626-
count: 1
4627-
path: ../src/Library/Encryption/JWEBuilder.php
4628-
46294611
-
46304612
rawMessage: 'Parameter #1 $algorithm of method Jose\Component\Core\AlgorithmManager::get() expects string, mixed given.'
46314613
identifier: argument.type
@@ -5286,16 +5268,10 @@ parameters:
52865268
count: 1
52875269
path: ../src/Library/KeyManagement/UrlKeySetFactory.php
52885270

5289-
-
5290-
rawMessage: 'Call to function assert() with true will always evaluate to true.'
5291-
identifier: function.alreadyNarrowedType
5292-
count: 1
5293-
path: ../src/Library/KeyManagement/UrlKeySetFactory.php
5294-
52955271
-
52965272
rawMessage: Instanceof between Symfony\Contracts\HttpClient\HttpClientInterface and Symfony\Contracts\HttpClient\HttpClientInterface will always evaluate to true.
52975273
identifier: instanceof.alwaysTrue
5298-
count: 2
5274+
count: 1
52995275
path: ../src/Library/KeyManagement/UrlKeySetFactory.php
53005276

53015277
-
@@ -5340,30 +5316,6 @@ parameters:
53405316
count: 1
53415317
path: ../src/Library/Signature/Algorithm/Util/RSA.php
53425318

5343-
-
5344-
rawMessage: 'Parameter #2 $protectedHeader of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, array<string, mixed> given.'
5345-
identifier: argument.type
5346-
count: 1
5347-
path: ../src/Library/Signature/JWS.php
5348-
5349-
-
5350-
rawMessage: 'Parameter #4 $header of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, array<string, mixed> given.'
5351-
identifier: argument.type
5352-
count: 1
5353-
path: ../src/Library/Signature/JWS.php
5354-
5355-
-
5356-
rawMessage: 'Parameter #2 $protectedHeader of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, array<string, mixed> given.'
5357-
identifier: argument.type
5358-
count: 1
5359-
path: ../src/Library/Signature/JWSBuilder.php
5360-
5361-
-
5362-
rawMessage: 'Parameter #4 $header of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, array<string, mixed> given.'
5363-
identifier: argument.type
5364-
count: 1
5365-
path: ../src/Library/Signature/JWSBuilder.php
5366-
53675319
-
53685320
rawMessage: 'Parameter #1 $algorithm of method Jose\Component\Core\AlgorithmManager::get() expects string, mixed given.'
53695321
identifier: argument.type
@@ -5383,7 +5335,7 @@ parameters:
53835335
path: ../src/Library/Signature/Serializer/CompactSerializer.php
53845336

53855337
-
5386-
rawMessage: 'Parameter #2 $protectedHeader of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, array<mixed, mixed> given.'
5338+
rawMessage: 'Parameter #2 $protectedHeader of method Jose\Component\Signature\JWS::addSignature() expects array<string, mixed>, array<mixed, mixed> given.'
53875339
identifier: argument.type
53885340
count: 1
53895341
path: ../src/Library/Signature/Serializer/CompactSerializer.php
@@ -5413,7 +5365,7 @@ parameters:
54135365
path: ../src/Library/Signature/Serializer/JSONFlattenedSerializer.php
54145366

54155367
-
5416-
rawMessage: 'Parameter #2 $protectedHeader of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, array<mixed> given.'
5368+
rawMessage: 'Parameter #2 $protectedHeader of method Jose\Component\Signature\JWS::addSignature() expects array<string, mixed>, array<mixed> given.'
54175369
identifier: argument.type
54185370
count: 1
54195371
path: ../src/Library/Signature/Serializer/JSONFlattenedSerializer.php
@@ -5425,7 +5377,7 @@ parameters:
54255377
path: ../src/Library/Signature/Serializer/JSONFlattenedSerializer.php
54265378

54275379
-
5428-
rawMessage: 'Parameter #4 $header of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, array<mixed> given.'
5380+
rawMessage: 'Parameter #4 $header of method Jose\Component\Signature\JWS::addSignature() expects array<string, mixed>, array<mixed> given.'
54295381
identifier: argument.type
54305382
count: 1
54315383
path: ../src/Library/Signature/Serializer/JSONFlattenedSerializer.php
@@ -5467,7 +5419,7 @@ parameters:
54675419
path: ../src/Library/Signature/Serializer/JSONGeneralSerializer.php
54685420

54695421
-
5470-
rawMessage: 'Parameter #2 $protectedHeader of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, mixed given.'
5422+
rawMessage: 'Parameter #2 $protectedHeader of method Jose\Component\Signature\JWS::addSignature() expects array<string, mixed>, mixed given.'
54715423
identifier: argument.type
54725424
count: 1
54735425
path: ../src/Library/Signature/Serializer/JSONGeneralSerializer.php
@@ -5485,8 +5437,7 @@ parameters:
54855437
path: ../src/Library/Signature/Serializer/JSONGeneralSerializer.php
54865438

54875439
-
5488-
rawMessage: 'Parameter #4 $header of method Jose\Component\Signature\JWS::addSignature() expects array{alg?: string, string?: mixed}, mixed given.'
5440+
rawMessage: 'Parameter #4 $header of method Jose\Component\Signature\JWS::addSignature() expects array<string, mixed>, mixed given.'
54895441
identifier: argument.type
54905442
count: 1
54915443
path: ../src/Library/Signature/Serializer/JSONGeneralSerializer.php
5492-

.ci-tools/phpunit.xml.dist

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
colors="true"
66
xsi:noNamespaceSchemaLocation="phpunit.xsd"
77
cacheDirectory=".phpunit.cache"
8+
executionOrder="default"
89
>
910
<coverage/>
1011
<testsuites>
@@ -27,7 +28,4 @@
2728
<directory>./../tests</directory>
2829
</exclude>
2930
</source>
30-
<extensions>
31-
<bootstrap class="Ergebnis\PHPUnit\SlowTestDetector\Extension"/>
32-
</extensions>
3331
</phpunit>

.ci-tools/rector.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
use Rector\Doctrine\Set\DoctrineSetList;
77
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
88
use Rector\PHPUnit\Set\PHPUnitSetList;
9+
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
910
use Rector\Set\ValueObject\LevelSetList;
1011
use Rector\Set\ValueObject\SetList;
12+
use Rector\Symfony\Symfony73\Rector\Class_\CommandHelpToAttributeRector;
1113
use Rector\ValueObject\PhpVersion;
1214

1315
$builder = RectorConfig::configure();
@@ -21,7 +23,6 @@
2123
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
2224
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
2325
PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
24-
PHPUnitSetList::PHPUNIT_120,
2526
]);
2627
$builder->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true);
2728
$builder->withPhpVersion(PhpVersion::PHP_82);
@@ -37,6 +38,8 @@
3738
);
3839
$builder->withSkip([
3940
PreferPHPUnitThisCallRector::class,
41+
RenameMethodRector::class => [__DIR__ . '/../tests'],
42+
CommandHelpToAttributeRector::class,
4043
__DIR__ . '/../src/Library/Core/JWKSet.php',
4144
__DIR__ . '/../src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php',
4245
__DIR__ . '/../src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php',

.github/workflows/ci.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- uses: actions/checkout@v5
4747

4848
- id: cache-key-generator
49-
run: echo "key=composer-${{ runner.os }}-${{ hashFiles('composer.lock') }}" >> $GITHUB_OUTPUT
49+
run: echo "key=composer-${{ runner.os }}-${{ hashFiles('composer.json', 'src/*/composer.json') }}" >> $GITHUB_OUTPUT
5050

5151
- uses: actions/cache@v4
5252
with:
@@ -205,7 +205,11 @@ jobs:
205205
fi
206206
207207
- name: Run PHPUnit
208-
run: castor phpunit
208+
run: |
209+
composer exec -- phpunit-11 \
210+
--coverage-xml .ci-tools/coverage \
211+
--log-junit=.ci-tools/coverage/junit.xml \
212+
--configuration .ci-tools/phpunit.xml.dist
209213
210214
infection:
211215
name: "🧬 Mutation Testing"
@@ -218,6 +222,20 @@ jobs:
218222
XDEBUG_MODE: coverage
219223
steps:
220224
- uses: actions/checkout@v5
225+
- uses: actions/cache@v4
226+
with:
227+
path: |
228+
vendor
229+
~/.composer/cache
230+
key: ${{ needs.prepare_dependencies.outputs.cache-key }}
231+
- name: Install dependencies
232+
run: composer install --no-interaction --no-progress
233+
- name: Generate coverage reports
234+
run: |
235+
composer exec -- phpunit-11 \
236+
--coverage-xml .ci-tools/coverage \
237+
--log-junit=.ci-tools/coverage/junit.xml \
238+
--configuration .ci-tools/phpunit.xml.dist
221239
- name: Execute Infection
222240
run: castor infect
223241

src/Bundle/DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* @param Source[] $sources
1616
*/
1717
public function __construct(
18-
private readonly string $alias,
19-
private readonly array $sources
18+
private string $alias,
19+
private array $sources
2020
) {
2121
}
2222

src/Bundle/DependencyInjection/Source/Checker/CheckerSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* @var Source[]
2525
*/
26-
private readonly array $sources;
26+
private array $sources;
2727

2828
public function __construct()
2929
{

src/Bundle/DependencyInjection/Source/Encryption/EncryptionSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* @var Source[]
3535
*/
36-
private readonly array $sources;
36+
private array $sources;
3737

3838
public function __construct()
3939
{

src/Bundle/DependencyInjection/Source/KeyManagement/KeyManagementSource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* @var Source[]
2626
*/
27-
private readonly array $sources;
27+
private array $sources;
2828

2929
public function __construct()
3030
{

src/Bundle/DependencyInjection/Source/NestedToken/NestedToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* @var Source[]
2020
*/
21-
private readonly array $sources;
21+
private array $sources;
2222

2323
public function __construct()
2424
{

0 commit comments

Comments
 (0)