Conversation
The Client class check added in api-platform#8574 ran first and autoloaded Client, which uses HttpClientTrait. Without symfony/http-client that is a fatal error, and the trait check that used to cover it was never reached. Fixes api-platform#8612 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
The five red checks are not caused by this change:
The jobs that run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #8574, the container fails to compile when
symfony/http-clientis not installed.class_exists(Client::class)ran first and autoloadedClient, which usesHttpClientTrait. That is a fatal error, and thetrait_exists(HttpClientTrait::class)guard that used to cover the case was never reached. TheClientcheck now runs after the trait check.Test:
TestClientPassTest::testProcessWithoutHttpClient. It runs in a separate process and hidesHttpClientTraitfrom the autoloaders, the same as an application withoutsymfony/http-client.Without the fix:
With the fix:
OK (4 tests, 6 assertions).tests/Symfony/Bundle/DependencyInjection/passes: 68 tests, 2 skipped. php-cs-fixer and PHPStan report nothing on the two changed files.I left CHANGELOG.md alone because its entries link to the commit hash.