Skip to content

Commit

Permalink
🐛 fix rejected Guzzle RejectedPromise error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanti authored Aug 26, 2022
1 parent 49cff98 commit ca7aa40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Utility/GuzzleUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
namespace Kanti\ServerTiming\Utility;

use Closure;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;

class GuzzleUtility
{
public static function getHandler(): Closure
{
return static function (callable $handler): Closure {
return static function (RequestInterface $request, array $options) use ($handler): FulfilledPromise {
return static function (RequestInterface $request, array $options) use ($handler): PromiseInterface {
$info = $request->getMethod() . ' ' . $request->getUri()->__toString();
$stop = TimingUtility::stopWatch('guzzle', $info);
$response = $handler($request, $options);
Expand Down

0 comments on commit ca7aa40

Please sign in to comment.