Skip to content

Commit

Permalink
guzzle 7 is psr18 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
stovak committed Jan 21, 2025
1 parent ddf9114 commit ed297a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
16 changes: 1 addition & 15 deletions src/Services/PantheonGuzzle.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
use Http\Factory\Guzzle\RequestFactory;
use Http\Factory\Guzzle\StreamFactory;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Solarium\Core\Client\Adapter\AdapterInterface;
use Solarium\Core\Client\Adapter\Psr18Adapter;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Session\AccountProxyInterface;

Expand All @@ -26,8 +23,7 @@
*/
class PantheonGuzzle extends Client implements
ClientInterface,
LoggerAwareInterface,
Psr18Adapter {
LoggerAwareInterface {
use LoggerAwareTrait;
use EndpointAwareTrait;

Expand Down Expand Up @@ -136,16 +132,6 @@ public function getQueryResult(
return (string) $response->getBody();
}

/**
* Get a PSR adapter interface based on this class.
*
* @return \Solarium\Core\Client\Adapter\AdapterInterface
* The interface in question.
*/
public function getPsr18Adapter(): AdapterInterface {
return $this;
}

/**
* Request Middleware Callback.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Services/SolariumClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(PantheonGuzzle $guzzle, Endpoint $endpoint, LoggerCh
$event_dispatcher = new Psr14Bridge($event_dispatcher);
}
parent::__construct(
$guzzle->getPsr18Adapter(),
$guzzle,
$event_dispatcher,
['endpoint' => [$endpoint]]
);
Expand Down

0 comments on commit ed297a3

Please sign in to comment.