Skip to content

Commit

Permalink
Merge pull request #11 from voku/analysis-orxZ2Q
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
voku authored Dec 8, 2021
2 parents f57bdf2 + 0adbfa0 commit 0c3c2c1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions examples/post_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
$http = new \Httpful\Factory();

$response = (new \Httpful\Client())->sendRequest(
$http->createRequest(
$http->createRequest(
\Httpful\Http::POST,
"https://postman-echo.com/post",
'https://postman-echo.com/post',
\Httpful\Mime::FORM,
$query
)
)
);
$result = $response->getRawBody();
echo $result['form']['foo1'] . "\n"; // response from postman
Expand All @@ -38,7 +38,7 @@
$response = (new \Httpful\Client())->sendRequest(
$http->createRequest(
\Httpful\Http::POST,
"https://postman-echo.com/post",
'https://postman-echo.com/post',
\Httpful\Mime::FORM,
$form
)->withAttachment(['foo2' => $filename])
Expand Down
2 changes: 1 addition & 1 deletion src/Httpful/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public function _curlPrep(): self

// set Content-Length to the size of the payload if present
if ($this->serialized_payload) {
$this->curl->setOpt(\CURLOPT_POSTFIELDS, $this->serialized_payload);
$this->curl->setOpt(\CURLOPT_POSTFIELDS, $this->serialized_payload);

if (!$this->isUpload()) {
$this->headers->forceSet('Content-Length', $this->_determineLength($this->serialized_payload));
Expand Down
6 changes: 3 additions & 3 deletions tests/Httpful/HttpfulTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ public function testJsonResponseParse()

static::assertSame('value', $response->getRawBody()['key']);
static::assertSame('value', $response->getRawBody()['object']['key']);
static::assertTrue(is_array( $response->getRawBody()['array']));
static::assertTrue(is_array($response->getRawBody()['array']));
static::assertSame(1, $response->getRawBody()['array'][0]);
}

Expand Down Expand Up @@ -420,10 +420,10 @@ public function testNoAutoParse()
{
$req = (new Request())->withMimeType(Mime::JSON)->disableAutoParsing();
$response = new Response(self::SAMPLE_JSON_RESPONSE, self::SAMPLE_JSON_HEADER, $req);
static::assertTrue(is_string( (string) $response->getBody()));
static::assertTrue(is_string((string) $response->getBody()));
$req = (new Request())->withMimeType(Mime::JSON)->enableAutoParsing();
$response = new Response(self::SAMPLE_JSON_RESPONSE, self::SAMPLE_JSON_HEADER, $req);
static::assertTrue(is_array( $response->getRawBody()));
static::assertTrue(is_array($response->getRawBody()));
}

public function testOverrideXmlHandler()
Expand Down
2 changes: 1 addition & 1 deletion tests/Httpful/StreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testConstructorInitializesProperties()
static::assertTrue($stream->isWritable());
static::assertTrue($stream->isSeekable());
static::assertSame('php://temp', $stream->getMetadata('uri'));
static::assertTrue(is_array( $stream->getMetadata()));
static::assertTrue(is_array($stream->getMetadata()));
static::assertSame(4, $stream->getSize());
static::assertFalse($stream->eof());
$stream->close();
Expand Down

0 comments on commit 0c3c2c1

Please sign in to comment.