Skip to content

Commit bafeb53

Browse files
committed
chore: changed setResponseContentsHandler function name for a more clear understanding of what it does
1 parent c9b90ab commit bafeb53

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Api.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ protected function request(
6868
}
6969

7070
if (!empty($this->queryDefaults)) {
71-
$query = array_merge($this->queryDefaults, $query);
71+
$query = \array_merge($this->queryDefaults, $query);
7272
}
7373

7474
if (!empty($this->headerDefaults)) {
75-
$headers = array_merge($this->headerDefaults, $headers);
75+
$headers = \array_merge($this->headerDefaults, $headers);
7676
}
7777

7878
$this->configurePlugins();
@@ -243,7 +243,7 @@ protected function addPostRequestHandler(callable $handler, int $priority = 0):
243243
return $this;
244244
}
245245

246-
protected function addResponseHandler(callable $handler, int $priority = 0): self
246+
protected function addResponseContentsHandler(callable $handler, int $priority = 0): self
247247
{
248248
$this->eventDispatcher->addListener(ResponseContentsEvent::class, $handler, $priority);
249249

tests/Integration/ApiTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public function addPostRequestHandler(callable $handler, int $priority = 0): Api
9898
return parent::addPostRequestHandler($handler, $priority);
9999
}
100100

101-
public function addResponseHandler(callable $handler, int $priority = 0): Api
101+
public function addResponseContentsHandler(callable $handler, int $priority = 0): Api
102102
{
103-
return parent::addResponseHandler($handler, $priority);
103+
return parent::addResponseContentsHandler($handler, $priority);
104104
}
105105

106106
public function buildPath(string $path, array $parameters): string
@@ -266,7 +266,7 @@ public function testResponseHandler()
266266
$this->mockClient->addResponse(new Response(body: MockResponse::SUCCESS));
267267

268268
$this->class->setBaseUrl(self::BASE_URL);
269-
$this->class->addResponseHandler(function(ResponseContentsEvent $event) {
269+
$this->class->addResponseContentsHandler(function(ResponseContentsEvent $event) {
270270
$contents = json_decode($event->getContents(), true);
271271
$event->setContents($contents);
272272
});

0 commit comments

Comments
 (0)