Skip to content

Declare strict types #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private function createCurlOptions(RequestInterface $request, ResponseBuilder $r
*
* @return int
*/
private function getProtocolVersion($requestVersion)
private function getProtocolVersion(string $requestVersion): int
{
switch ($requestVersion) {
case '1.0':
Expand All @@ -265,7 +265,7 @@ private function getProtocolVersion($requestVersion)
*
* @return array
*/
private function addRequestBodyOptions(RequestInterface $request, array $options)
private function addRequestBodyOptions(RequestInterface $request, array $options): array
{
/*
* Some HTTP methods cannot have payload:
Expand Down Expand Up @@ -319,7 +319,7 @@ private function addRequestBodyOptions(RequestInterface $request, array $options
*
* @return string[]
*/
private function createHeaders(RequestInterface $request, array $options)
private function createHeaders(RequestInterface $request, array $options): array
{
$curlHeaders = [];
$headers = $request->getHeaders();
Expand Down Expand Up @@ -358,7 +358,7 @@ private function createHeaders(RequestInterface $request, array $options)
*
* @throws \RuntimeException If creating the stream from $body fails
*/
private function createResponseBuilder()
private function createResponseBuilder(): ResponseBuilder
{
try {
$body = $this->streamFactory->createStream(fopen('php://temp', 'w+b'));
Expand Down
2 changes: 2 additions & 0 deletions src/CurlPromise.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl;

use Http\Promise\Promise;
Expand Down
2 changes: 2 additions & 0 deletions src/MultiRunner.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl;

use Http\Client\Exception\RequestException;
Expand Down
2 changes: 2 additions & 0 deletions src/PromiseCore.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl;

use Http\Client\Exception;
Expand Down
2 changes: 2 additions & 0 deletions src/ResponseBuilder.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl;

use Http\Message\Builder\ResponseBuilder as OriginalResponseBuilder;
Expand Down
2 changes: 2 additions & 0 deletions tests/BaseUnitTestCase.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Curl\PromiseCore;
Expand Down
2 changes: 2 additions & 0 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Curl\Client;
Expand Down
2 changes: 2 additions & 0 deletions tests/CurlPromiseTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Curl\CurlPromise;
Expand Down
2 changes: 2 additions & 0 deletions tests/HttpAsyncClientDiactorosTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Curl\Client;
Expand Down
2 changes: 2 additions & 0 deletions tests/HttpAsyncClientGuzzleTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Curl\Client;
Expand Down
2 changes: 2 additions & 0 deletions tests/HttpAsyncClientTestCase.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Tests\HttpAsyncClientTest;
Expand Down
2 changes: 2 additions & 0 deletions tests/HttpClientDiactorosTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Curl\Client;
Expand Down
2 changes: 2 additions & 0 deletions tests/HttpClientGuzzleTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use GuzzleHttp\Psr7\Stream;
Expand Down
2 changes: 2 additions & 0 deletions tests/HttpClientTestCase.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Tests\HttpClientTest;
Expand Down
2 changes: 2 additions & 0 deletions tests/PromiseCoreTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Http\Client\Curl\Tests;

use Http\Client\Curl\PromiseCore;
Expand Down