Skip to content

[HttpClient] Remove support for amphp/http-client < 5 #60712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jun 5, 2025

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 8.0
Bug fix? yes
New feature? yes
Deprecations? no
Issues -
License MIT

alexandre-daubois and others added 11 commits June 4, 2025 09:44
…ath::key()` (alexandre-daubois)

This PR was merged into the 7.3 branch.

Discussion
----------

[JsonPath] Always use brackets notation with `JsonPath::key()`

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix symfony#60664
| License       | MIT

As explained in the issue, the dot notation can lead to invalid paths when used with some identifiers (for example, when it contains a `-`). The issue gives the following example:

```php
use Symfony\Component\JsonPath\JsonCrawler;
use Symfony\Component\JsonPath\JsonPath;

$jsonPathExpression = (string) (new JsonPath)->key('some-prop');

dump((new JsonCrawler('{"some-prop": "example value"}'))->find($jsonPathExpression));
```

Let's always use the brackets notation in `JsonPath::key()`. Dot notation is only a shorthand to the verbose brackets version and this solves the problem without having to do further analysis on the key.

Added a few tests to ensure the brackets notation works well too.

Commits
-------

442970b [JsonPath] Always use brackets notation with `JsonPath::key()`
…las-grekas)

This PR was merged into the 7.3 branch.

Discussion
----------

[Security] Keep roles when serializing tokens

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix symfony#60656, Fix symfony#60687
| License       | MIT

Looks like I missed something in symfony#59558

Commits
-------

8092ffd [Security] Keep roles when serializing tokens
…earDownAfterClass (cquintana92)"

This reverts commit ec76ab4, reversing
changes made to bc88600.
…fterClass (cquintana92)

This PR was submitted for the 7.4 branch but it was squashed and merged into the 6.4 branch instead.

Discussion
----------

[FrameworkBundle] ensureKernelShutdown in tearDownAfterClass

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | None
| License       | MIT

Comes from symfony#60564

This PR performs the following change: In `KernelTestCase`, the kernel is shut down after every test, as per the `static::ensureKernelShutdown()` call in the `tearDown` function. However, if one was to perform any extra code in their `tearDownAfterClass` and call `getContainer`, it would boot up a new kernel, which would then be left dangling. The main issue with that is that when the next Test class is executed, there would already be a booted kernel, so it could happen that it was pointing to dangling resources.

By adding this call to `static::ensureKernelShutdown` in the `tearDownAfterClass`, we can ensure that no dangling kernels are left even after the test class has finished.

Commits
-------

c193b98 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass
…eprecation messages (dheineman)

This PR was merged into the 7.3 branch.

Discussion
----------

[WebProfilerBundle] Fix typos in routing config deprecation messages

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Fixes some typos in the deprecation messages introduced in symfony#60232.

Commits
-------

2547946 [WebProfilerBundle] Fix typos in routing config deprecation messages
use Symfony\Component\HttpClient\Response\ResponseStream;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
use Symfony\Contracts\HttpClient\ResponseStreamInterface;
use Symfony\Contracts\Service\ResetInterface;

if (!interface_exists(DelegateHttpClient::class)) {
throw new \LogicException('You cannot use "Symfony\Component\HttpClient\AmpHttpClient" as the "amphp/http-client" package is not installed. Try running "composer require amphp/http-client:^4.2.1".');
throw new \LogicException('You cannot use "Symfony\Component\HttpClient\AmpHttpClient" as the "amphp/http-client" package is not installed. Try running "composer require amphp/http-client:^5".');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fixed on 7.4 as dc09be9

@nicolas-grekas nicolas-grekas force-pushed the hc-amp5 branch 3 times, most recently from 4a450b2 to c6bf4dc Compare June 5, 2025 15:30
* 6.4:
  cs tweak
  [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass
  Revert "bug symfony#60564 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass (cquintana92)"
* 7.2:
  cs tweak
  [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass
  Revert "bug symfony#60564 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass (cquintana92)"
…ult (nicolas-grekas)

This PR was merged into the 7.3 branch.

Discussion
----------

[HttpClient] Suggest amphp/http-client v5 by default

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Commits
-------

851c22c [HttpClient] Suggest amphp/http-client v5 by default
* 7.3:
  [HttpClient] Suggest amphp/http-client v5 by default
  [WebProfilerBundle] Fix typos in routing config deprecation messages
  cs tweak
  [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass
  Revert "bug symfony#60564 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass (cquintana92)"
  [Security] Keep roles when serializing tokens
  [JsonPath] Always use brackets notation with `JsonPath::key()`
…olas-grekas)

This PR was merged into the 7.4 branch.

Discussion
----------

[Security] conflict with event-subscriber v8

| Q             | A
| ------------- | ---
| Branch?       | 7.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

`Http\Firewall` doesn't have return types in v7.4 to make upgrades smoother, but this also means that this class is not compatible with `EventSubscriberInterface` v8 since we added return types there.

Commits
-------

542cc71 [Security] conflict with event-subscriber v8
* 7.4:
  [HttpClient] Suggest amphp/http-client v5 by default
  [Security] conflict with event-subscriber v8
  Fix leftover
  [WebProfilerBundle] Fix typos in routing config deprecation messages
  cs tweak
  [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass
  Revert "bug symfony#60564 [FrameworkBundle] ensureKernelShutdown in tearDownAfterClass (cquintana92)"
  [Security] Keep roles when serializing tokens
  [JsonPath] Always use brackets notation with `JsonPath::key()`
@nicolas-grekas nicolas-grekas requested a review from chalasr as a code owner June 5, 2025 15:44
@nicolas-grekas nicolas-grekas merged commit 5a700f2 into symfony:8.0 Jun 5, 2025
6 of 8 checks passed
@nicolas-grekas nicolas-grekas deleted the hc-amp5 branch June 5, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants