Skip to content

Commit b8270ea

Browse files
author
Garry Filakhtov
authored
Merge pull request #65 from bigcommerce/fix-state-carrying
Fix state carrying in the Client
2 parents 037fa1c + 7815f6d commit b8270ea

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Grphp/Client.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ public function call(Message $request, string $method, array $metadata = [], arr
6464
{
6565
$metadata = array_merge($this->buildAuthenticationMetadata(), $metadata);
6666

67-
return $this->intercept($this->interceptors, $request, $method, $metadata, $options, fn () =>
67+
return $this->intercept($this->interceptors, $request, $method, $metadata, $options, fn (
68+
string $method,
69+
Message $request,
70+
array $metadata,
71+
array $options,
72+
) =>
6873
$this->config->getStrategy()->execute(new Request(
6974
$this->config,
7075
$method,
@@ -127,7 +132,7 @@ private function buildAuthenticationMetadata(): array
127132
* Intercept the call with the registered interceptors for the client
128133
*
129134
* @param array<Interceptor> $interceptors
130-
* @param callable(): Response $callback
135+
* @param callable(string, Message, array, array): Response $callback
131136
*/
132137
private function intercept(
133138
array $interceptors,
@@ -139,7 +144,7 @@ private function intercept(
139144
): Response {
140145
$i = array_shift($interceptors);
141146
if (!$i) {
142-
return $callback();
147+
return $callback($method, $request, $metadata, $options);
143148
}
144149

145150
$i->setRequest($request);

0 commit comments

Comments
 (0)