Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Jun 4, 2019
1 parent efc20f7 commit 4804182
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion lib/ApplicationInterceptor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


namespace Amp\Http\Client;

use Amp\CancellationToken;
Expand Down
1 change: 0 additions & 1 deletion lib/HttpSocketPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Amp\CancellationToken;
use Amp\Failure;
use Amp\Promise;
use Amp\Socket\BasicSocketPool;
use Amp\Socket\ConnectContext;
use Amp\Socket\EncryptableSocket;
use Amp\Socket\ResourceSocket;
Expand Down
5 changes: 2 additions & 3 deletions lib/SocketClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ private function normalizeRequestHostHeader(Request $request): Request
// if it's a standard 80 or 443
if ($request->getUri()->getScheme() === 'http' && \strpos($host, ':80') === \strlen($host) - 3) {
$request = $request->withHeader('host', \substr($host, 0, -3));
} else if ($request->getUri()->getScheme() === 'https' && \strpos($host, ':443') === \strlen($host) - 4) {
} elseif ($request->getUri()->getScheme() === 'https' && \strpos($host, ':443') === \strlen($host) - 4) {
$request = $request->withHeader('host', \substr($host, 0, -4));
} else {
$request = $request->withHeader('host', $host);
Expand Down Expand Up @@ -463,8 +463,7 @@ private function finalizeResponse(
Promise $completionPromise
): Response {
$body = new IteratorStream($bodyEmitter->iterate());
$body = new class($body, $bodyCancellation) implements InputStream
{
$body = new class($body, $bodyCancellation) implements InputStream {
private $body;
private $bodyCancellation;
private $successfulEnd = false;
Expand Down
9 changes: 3 additions & 6 deletions test/ClientHttpBinIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,7 @@ public function testContentLengthBodyMismatchWithTooManyBytesSimple(): \Generato
$this->expectExceptionMessage("Body contained more bytes than specified in Content-Length, aborting request");

$request = (new Request("http://httpbin.org/post", "POST"))
->withBody(new class implements RequestBody
{
->withBody(new class implements RequestBody {
public function getHeaders(): Promise
{
return new Success([]);
Expand All @@ -411,8 +410,7 @@ public function testContentLengthBodyMismatchWithTooManyBytesWith3ByteChunksAndL
$this->expectExceptionMessage("Body contained more bytes than specified in Content-Length, aborting request");

$request = (new Request("http://httpbin.org/post", "POST"))
->withBody(new class implements RequestBody
{
->withBody(new class implements RequestBody {
public function getHeaders(): Promise
{
return new Success([]);
Expand All @@ -438,8 +436,7 @@ public function testContentLengthBodyMismatchWithTooFewBytes(): \Generator
$this->expectExceptionMessage("Body contained fewer bytes than specified in Content-Length, aborting request");

$request = (new Request("http://httpbin.org/post", "POST"))
->withBody(new class implements RequestBody
{
->withBody(new class implements RequestBody {
public function getHeaders(): Promise
{
return new Success([]);
Expand Down
1 change: 0 additions & 1 deletion test/TimeoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Amp\Deferred;
use Amp\Http\Client\ClientBuilder;
use Amp\Http\Client\Request;
use Amp\Http\Client\RequestOptions;
use Amp\Http\Client\Response;
use Amp\Http\Client\SocketClient;
use Amp\Http\Client\TimeoutException;
Expand Down

0 comments on commit 4804182

Please sign in to comment.