@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | |
| 32 | 32 | $client = new Client(array_merge( |
| 33 | - ['base_uri' => $this->getBaseUri()], |
|
| 33 | + [ 'base_uri' => $this->getBaseUri() ], |
|
| 34 | 34 | $options |
| 35 | 35 | )); |
| 36 | 36 | |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | $guzzleRequest = $this->client->createRequest( |
| 70 | 70 | $request->getMethod(), |
| 71 | 71 | $request->getUri(), |
| 72 | - ['headers' => $request->getHeaders()] |
|
| 72 | + [ 'headers' => $request->getHeaders() ] |
|
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | 75 | $guzzleRequest->setBody(Stream::factory($request->getBody())); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | class Guzzle3Mock |
| 11 | 11 | { |
| 12 | 12 | /** |
| 13 | - * @param array $responseCollection |
|
| 13 | + * @param Psr7Response[] $responseCollection |
|
| 14 | 14 | * @return \CanalTP\AbstractGuzzle\Guzzle |
| 15 | 15 | */ |
| 16 | 16 | public function getMock(array $responseCollection) |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use CanalTP\AbstractGuzzle\GuzzleFactory; |
| 6 | 6 | use GuzzleHttp\Message\Response; |
| 7 | -use GuzzleHttp\Psr7\Response as psr7Response; |
|
| 8 | 7 | use GuzzleHttp\Stream\Stream; |
| 9 | 8 | use GuzzleHttp\Subscriber\Mock; |
| 10 | 9 | |
@@ -16,18 +16,18 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function getMock(array $responseCollection) |
| 18 | 18 | { |
| 19 | - $version5ResponseCollection = []; |
|
| 19 | + $version5ResponseCollection = [ ]; |
|
| 20 | 20 | $client = GuzzleFactory::createClient(''); |
| 21 | 21 | |
| 22 | 22 | foreach ($responseCollection as $response) { |
| 23 | 23 | if ($response instanceof Psr7Response) { |
| 24 | - $version5ResponseCollection[] = new Response( |
|
| 24 | + $version5ResponseCollection[ ] = new Response( |
|
| 25 | 25 | $response->getStatusCode(), |
| 26 | 26 | $response->getHeaders(), |
| 27 | 27 | Stream::factory($response->getBody()->getContents()) |
| 28 | 28 | ); |
| 29 | 29 | } else { |
| 30 | - $version5ResponseCollection[] = new Response(); |
|
| 30 | + $version5ResponseCollection[ ] = new Response(); |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | $mock = new Mock($version5ResponseCollection); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * |
| 15 | 15 | * @throws NotSupportedException when Guzzle vendor version is not supported. |
| 16 | 16 | */ |
| 17 | - public static function createClient($baseUri, $options = []) |
|
| 17 | + public static function createClient($baseUri, $options = [ ]) |
|
| 18 | 18 | { |
| 19 | 19 | $guzzleVersion = self::detectGuzzleVersion(); |
| 20 | 20 | |
@@ -21,6 +21,6 @@ |
||
| 21 | 21 | $mock = new MockHandler($responseCollection); |
| 22 | 22 | $handler = HandlerStack::create($mock); |
| 23 | 23 | |
| 24 | - return GuzzleFactory::createClient('', ['handler' => $handler]); |
|
| 24 | + return GuzzleFactory::createClient('', [ 'handler' => $handler ]); |
|
| 25 | 25 | } |
| 26 | 26 | } |