Skip to content

ci: add to the PHPStan baseline the four errors reported on 5.0.x whatever the change - #834

Merged
Spomky merged 1 commit into
5.0.xfrom
ci/phpstan-baseline-5-0-x
Nov 29, 2026
Merged

Spomky merged 1 commit into
5.0.xfrom
ci/phpstan-baseline-5-0-x

Conversation

@Spomky

@Spomky Spomky commented Nov 29, 2026

Copy link
Copy Markdown
Member

The same repair as #832, on 5.0.x. The Static Analysis job fails on 5.0.x whatever the change, so the tests job, which needs it, is skipped: the drafts #783 and #786 hit it. The last green run on 5.0.x is the one of 893f4c07 (2026-11-08).

The cause

The same four errors as on 4.3.x, none of them from the code:

  • PHPStan 2.3.7, which the phpqa image has shipped since its rebuild of 2026-11-20, reports a mixed value as a condition in three places:
    • the ternary of JSONFlattenedSerializer::processHeaders();
    • the ternary of JSONGeneralSerializer::processHeaders();
    • the if of MixedPublicAndPrivateKeys.
  • symfony/dependency-injection 8.2.0 declares the $config argument of ContainerBuilder::prependExtensionConfig() as array<string, mixed>, and ConfigurationHelper::updateJoseConfiguration() passes an array<mixed>.

The fix

The baseline, generated by castor phpstan-baseline with the current image (phpqa:8.4 of 2026-11-28) after a clean composer install of 5.0.x, gains those four entries and nothing else. They are the same entries as in #832.

Verification

PHPStan on 5.0.x: 4 errors before, [OK] No errors after.

…tever the change

The Static Analysis job fails on 5.0.x for the reasons fixed on 4.3.x by
#832:

- PHPStan 2.3.7, shipped by the phpqa image since its rebuild of
  2026-11-20, reports a mixed value as the condition of the ternaries of
  the processHeaders() methods of JSONFlattenedSerializer and
  JSONGeneralSerializer and of the if of MixedPublicAndPrivateKeys;
- symfony/dependency-injection 8.2.0 declares the $config argument of
  ContainerBuilder::prependExtensionConfig() as array<string, mixed>,
  while ConfigurationHelper::updateJoseConfiguration() passes an
  array<mixed>.

The baseline, generated by castor phpstan-baseline with the current
image, gains those four entries and nothing else.
@Spomky Spomky added this to the 5.0.0 milestone Nov 29, 2026
Spomky added a commit that referenced this pull request Nov 29, 2026
…factory-5.0.x

5.0.x is taken with the PHPStan baseline of #834. #779 reached 5.0.x
through 4.3.x, so its merge is resolved as the description of this pull
request plans:

- the four factories keep the create() of this branch: the branch that
  throws when header checkers are requested without a header checker
  manager factory has no case left, and its import goes with it;
- the #779 tests that need a factory without header checker manager
  factory are dropped: headerCheckersAreRefusedWithoutAHeaderCheckerManagerFactory
  and aLoaderWithoutHeaderCheckersNeedsNoHeaderCheckerManagerFactory in
  JWELoaderFactoryTest and JWSLoaderFactoryTest, NestedTokenLoaderFactoryTest,
  the two bundle tests that build a factory with null, and the autowired
  library factories of the test bundle with the two tests that use them;
- theRequestedHeaderCheckersAreGivenToTheLoader stays.
@Spomky
Spomky merged commit bfad1d7 into 5.0.x Nov 29, 2026
18 checks passed
@Spomky
Spomky deleted the ci/phpstan-baseline-5-0-x branch November 29, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant