From cc33fc736fa428475dca3fb578dde7505ee8f8ea Mon Sep 17 00:00:00 2001 From: Pavel Zotikov Date: Wed, 18 Sep 2024 17:41:18 +0300 Subject: [PATCH 1/2] Initialize Guzzle client internally within Transport --- src/DependencyInjection/HawkExtension.php | 4 +--- src/Transport/GuzzlePromisesTransport.php | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/DependencyInjection/HawkExtension.php b/src/DependencyInjection/HawkExtension.php index bb82d2b..01f6445 100644 --- a/src/DependencyInjection/HawkExtension.php +++ b/src/DependencyInjection/HawkExtension.php @@ -4,7 +4,6 @@ namespace HawkBundle\DependencyInjection; -use GuzzleHttp\Client; use HawkBundle\Catcher; use HawkBundle\Monolog\Handler; use HawkBundle\Transport\GuzzlePromisesTransport; @@ -33,8 +32,7 @@ public function load(array $configs, ContainerBuilder $container) $container->setParameter('hawk.integration_token', $config['integration_token']); // Register TransportInterface - $container->register(GuzzlePromisesTransport::class) - ->setArgument('$client', new Reference(Client::class)); + $container->register(GuzzlePromisesTransport::class); // Register Catcher $container->register(Catcher::class) diff --git a/src/Transport/GuzzlePromisesTransport.php b/src/Transport/GuzzlePromisesTransport.php index 187fdf0..ad1c453 100644 --- a/src/Transport/GuzzlePromisesTransport.php +++ b/src/Transport/GuzzlePromisesTransport.php @@ -21,12 +21,10 @@ class GuzzlePromisesTransport implements TransportInterface /** * CurlTransport constructor. - * - * @param Client $client */ - public function __construct(Client $client) + public function __construct() { - $this->client = $client; + $this->client = new Client(); } /** From be7705817ab9b6db64cb6a4033c1f136c2574e2c Mon Sep 17 00:00:00 2001 From: Pavel Zotikov Date: Wed, 18 Sep 2024 17:44:51 +0300 Subject: [PATCH 2/2] update version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1c1acc8..957e45d 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Symfony errors Catcher module for Hawk.so", "keywords": ["hawk", "php", "error", "catcher", "monolog", "symfony"], "type": "library", - "version": "0.0.1", + "version": "0.0.2", "license": "MIT", "require": { "php": "^7.2 || ^8.0",