Skip to content

Drop support for Symfony versions <5.4 #441

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 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ jobs:
symfony-deprecations-helper: "weak"

# Test maintained versions of Symfony
- dependencies: "php-http/guzzle7-adapter symfony/http-client:^4.4"
symfony-require: "4.4.*"
php-version: "7.3"
symfony-deprecations-helper: "weak"
- dependencies: "php-http/guzzle7-adapter symfony/http-client:^5.0"
- dependencies: "php-http/guzzle7-adapter symfony/http-client:^5.4"
symfony-require: "5.4.*"
php-version: "7.3"
symfony-deprecations-helper: "weak"
- dependencies: "php-http/guzzle7-adapter symfony/http-client:^6.0"
symfony-require: "6.3.*"
php-version: "8.2"
symfony-deprecations-helper: "weak"

steps:
- name: "Checkout"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
- Removed support of deprecated PHP-HTTP factories, only PSR-17 factories are now supported and used.
- Removed `message_factory`, `uri_factory`, and `stream_factory` classes config option. You can configure your own factories via psr17_*_factory classes config
- Removed support for guzzle5-adapter
- Removed support for Symfony versions <5.4

# Version 1

Expand Down
31 changes: 16 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"php-http/stopwatch-plugin": "^1.2",
"psr/http-factory-implementation": "^1.0",
"psr/http-message": "^1.0 || ^2.0",
"symfony/config": "^4.4 || ^5.0 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
"symfony/event-dispatcher": "^4.4 || ^5.0 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0",
"symfony/options-resolver": "^4.4 || ^5.0 || ^6.0"
"symfony/config": "^5.4 || ^6.0",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/event-dispatcher": "^5.4 || ^6.0",
"symfony/http-kernel": "^5.4 || ^6.0",
"symfony/options-resolver": "^5.4 || ^6.0"
},
"conflict": {
"php-http/guzzle6-adapter": "<1.1",
Expand All @@ -57,15 +57,15 @@
"php-http/cache-plugin": "^1.7",
"php-http/mock-client": "^1.2",
"php-http/promise": "^1.0",
"symfony/browser-kit": "^4.4 || ^5.0 || ^6.0",
"symfony/cache": "^4.4 || ^5.0 || ^6.0",
"symfony/dom-crawler": "^4.4 || ^5.0 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/http-foundation": "^4.4.19 || ^5.0 || ^6.0",
"symfony/phpunit-bridge": "^5.3",
"symfony/stopwatch": "^4.4 || ^5.0 || ^6.0",
"symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/web-profiler-bundle": "^4.4.19 || ^5.0 || ^6.0",
"symfony/browser-kit": "^5.4 || ^6.0",
"symfony/cache": "^5.4 || ^6.0",
"symfony/dom-crawler": "^5.4 || ^6.0",
"symfony/framework-bundle": "^5.4 || ^6.0",
"symfony/http-foundation": "^5.4 || ^6.0",
"symfony/phpunit-bridge": "^5.4 || ^6.0",
"symfony/stopwatch": "^5.4 || ^6.0",
"symfony/twig-bundle": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"twig/twig": "^1.41 || ^2.10 || ^3.0"
},
"suggest": {
Expand All @@ -76,7 +76,8 @@
"config": {
"sort-packages": true,
"allow-plugins": {
"symfony/flex": true
"symfony/flex": true,
"php-http/discovery": false
}
},
"autoload": {
Expand Down
10 changes: 1 addition & 9 deletions src/Collector/PluginClientFactoryListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@
namespace Http\HttplugBundle\Collector;

use Http\Client\Common\PluginClientFactory as DefaultPluginClientFactory;
use Symfony\Component\EventDispatcher\Event as LegacyEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Contracts\EventDispatcher\Event;

if (Kernel::MAJOR_VERSION >= 5) {
\class_alias(Event::class, 'Http\HttplugBundle\Collector\PluginClientFactoryListenerEventClass');
} else {
\class_alias(LegacyEvent::class, 'Http\HttplugBundle\Collector\PluginClientFactoryListenerEventClass');
}

/**
* This subscriber ensures that every PluginClient created when using Http\Client\Common\PluginClientFactory without
* using the Symfony dependency injection container uses the Http\HttplugBundle\Collector\PluginClientFactory factory
Expand All @@ -40,7 +32,7 @@ public function __construct(PluginClientFactory $factory)
/**
* Make sure to profile clients created using PluginClientFactory.
*/
public function onEvent(PluginClientFactoryListenerEventClass $e)
public function onEvent(Event $e)
{
DefaultPluginClientFactory::setFactory([$this->factory, 'createClient']);
}
Expand Down