Skip to content

Commit 2f95500

Browse files
committed
Rename methods
1 parent faa418c commit 2f95500

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function run(Request $request) : Response
6161
\curl_setopt_array($handle, $options);
6262
$body = \curl_exec($handle);
6363
$info = [];
64-
if ($request->isGettingResponseInfo()) {
64+
if ($request->isGettingInfo()) {
6565
$info = (array) \curl_getinfo($handle);
6666
}
6767
if ($body === false) {
@@ -117,7 +117,7 @@ public function runMulti(array $requests) : Generator
117117
foreach ($handles as $id => $handle) {
118118
if ($message['handle'] === $handle) {
119119
$info = [];
120-
if ($requests[$id]->isGettingResponseInfo()) {
120+
if ($requests[$id]->isGettingInfo()) {
121121
$info = (array) \curl_getinfo($handle);
122122
}
123123
$objectId = \spl_object_id($handle);

src/Request.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Request extends Message implements RequestInterface
7171
*/
7272
protected array $options = [];
7373
protected bool $checkOptions = false;
74-
protected bool $getResponseInfo = false;
74+
protected bool $getInfo = false;
7575

7676
/**
7777
* Request constructor.
@@ -716,15 +716,15 @@ public function getPostAndFiles() : array | string
716716
return \array_replace($post, $files);
717717
}
718718

719-
public function setGetResponseInfo(bool $get = true) : static
719+
public function setGetInfo(bool $get = true) : static
720720
{
721-
$this->getResponseInfo = $get;
721+
$this->getInfo = $get;
722722
return $this;
723723
}
724724

725-
public function isGettingResponseInfo() : bool
725+
public function isGettingInfo() : bool
726726
{
727-
return $this->getResponseInfo;
727+
return $this->getInfo;
728728
}
729729

730730
/**

tests/ClientTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testRun() : void
4747
self::assertEmpty($response->getInfo());
4848
$request->setOption(\CURLOPT_RETURNTRANSFER, false);
4949
\ob_start(); // Avoid terminal output
50-
$request->setGetResponseInfo();
50+
$request->setGetInfo();
5151
$response = $this->client->run($request);
5252
self::assertInstanceOf(Response::class, $response);
5353
self::assertSame('', $response->getBody());
@@ -111,7 +111,7 @@ public function testRunError() : void
111111
public function testRunErrorWithInfo() : void
112112
{
113113
$request = new Request('http://domain.tld');
114-
$request->setGetResponseInfo();
114+
$request->setGetInfo();
115115
try {
116116
$this->client->run($request);
117117
} catch (RequestException $exception) {
@@ -169,8 +169,8 @@ public function testRunMultiGettingResponseInfo() : void
169169
new Request('http://not-exist.tld'),
170170
new Request('https://www.google.com'),
171171
];
172-
$requests[0]->setGetResponseInfo();
173-
$requests[1]->setGetResponseInfo();
172+
$requests[0]->setGetInfo();
173+
$requests[1]->setGetInfo();
174174
$responses = $this->client->runMulti($requests);
175175
$returned = [];
176176
while ($responses->valid()) {

0 commit comments

Comments
 (0)