From ca4bb080bc90f9df59f5cd7f2c1351c06c98a0be Mon Sep 17 00:00:00 2001 From: Matthew Goslett Date: Wed, 24 May 2017 08:47:43 +0200 Subject: [PATCH] Apply fixes from StyleCI (#1) --- src/HTTPPubSubAdapter.php | 8 +++++--- tests/HTTPPubSubAdapterTest.php | 16 ++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/HTTPPubSubAdapter.php b/src/HTTPPubSubAdapter.php index 238f9b7..4965e6f 100644 --- a/src/HTTPPubSubAdapter.php +++ b/src/HTTPPubSubAdapter.php @@ -60,7 +60,6 @@ public function setUri($uri) } /** - * * Return the uri of the service where messages will be published to. * * @return string @@ -119,6 +118,7 @@ public function getGlobalHeaders() * @param string $endpoint * @param mixed $body * @param array $headers + * * @return Request */ protected function createRequest($method, $endpoint, $body = null, array $headers = []) @@ -132,12 +132,13 @@ protected function createRequest($method, $endpoint, $body = null, array $header * Send an HTTP request. * * @param RequestInterface $request + * * @return array */ protected function sendRequest(RequestInterface $request) { $response = $this->client->send($request); - /** @var \Psr\Http\Message\ResponseInterface $response */ + /* @var \Psr\Http\Message\ResponseInterface $response */ return json_decode($response->getBody(), true); } @@ -147,6 +148,7 @@ protected function sendRequest(RequestInterface $request) * * @param string $endpoint * @param array $data + * * @return mixed */ public function post($endpoint, array $data = []) @@ -188,4 +190,4 @@ public function publishBatch($channel, array $messages) { $this->post(sprintf('messages/%s', $channel), ['messages' => $messages]); } -} \ No newline at end of file +} diff --git a/tests/HTTPPubSubAdapterTest.php b/tests/HTTPPubSubAdapterTest.php index bdd8d1a..3f76861 100644 --- a/tests/HTTPPubSubAdapterTest.php +++ b/tests/HTTPPubSubAdapterTest.php @@ -82,7 +82,7 @@ public function testPost() 'POST', 'messages/test', json_encode(['messages' => ['hello', 'world']]), - ['Content-Type' => 'application/json'] + ['Content-Type' => 'application/json'], ]) ->once() ->andReturn($request); @@ -103,7 +103,7 @@ public function testSubscribe() $subscribeAdapter->shouldReceive('subscribe') ->withArgs([ 'test', - $handler + $handler, ]) ->once(); @@ -127,9 +127,9 @@ public function testPublish() 'messages' => [ [ 'hello' => 'world', - ] + ], ], - ] + ], ]) ->once(); $adapter->publish('test', ['hello' => 'world']); @@ -151,17 +151,17 @@ public function testPublishBatch() 'test', [ 'hello' => 'world', - ] + ], ], - ] + ], ]) ->once(); $messages = [ 'test', [ 'hello' => 'world', - ] + ], ]; $adapter->publishBatch('test', $messages); } -} \ No newline at end of file +}