Skip to content

Commit

Permalink
wip xizhi
Browse files Browse the repository at this point in the history
  • Loading branch information
guanguans committed Jan 18, 2024
1 parent ca7a7cd commit ca3b4e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Foundation/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(Credential $credential = null, array $httpOptions =
public function send(HttpMessage $httpMessage): ResponseInterface
{
return $this
->pushMiddleware((new ApplyCredentialToRequest($this->credential))(), ApplyCredentialToRequest::name())
->pushMiddleware(new ApplyCredentialToRequest($this->credential), ApplyCredentialToRequest::name())
->createDefaultHttClient($this->httpOptions)
->request($httpMessage->httpMethod(), $httpMessage->httpUri(), $httpMessage->httpOptions());
}
Expand Down
4 changes: 2 additions & 2 deletions src/Foundation/Middleware/ApplyCredentialToRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public static function name(): string
return 'credential';
}

public function __invoke(): callable
public function __invoke(callable $handler): callable
{
return Middleware::mapRequest(function (RequestInterface $request): RequestInterface {
return $this->credential->applyToRequest($request);
});
})($handler);
}
}

0 comments on commit ca3b4e1

Please sign in to comment.