Skip to content

Commit

Permalink
Merge pull request #2 from codex-team/feature/internal-guzzle-client-…
Browse files Browse the repository at this point in the history
…transport

Move Guzzle Client initialization to GuzzlePromisesTransport
  • Loading branch information
pavelzotikov authored Sep 18, 2024
2 parents c68f878 + be77058 commit 40415b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions src/DependencyInjection/HawkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace HawkBundle\DependencyInjection;

use GuzzleHttp\Client;
use HawkBundle\Catcher;
use HawkBundle\Monolog\Handler;
use HawkBundle\Transport\GuzzlePromisesTransport;
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions src/Transport/GuzzlePromisesTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit 40415b3

Please sign in to comment.