Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit ca4bb08

Browse files
Apply fixes from StyleCI (#1)
1 parent 9c7c50f commit ca4bb08

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/HTTPPubSubAdapter.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public function setUri($uri)
6060
}
6161

6262
/**
63-
*
6463
* Return the uri of the service where messages will be published to.
6564
*
6665
* @return string
@@ -119,6 +118,7 @@ public function getGlobalHeaders()
119118
* @param string $endpoint
120119
* @param mixed $body
121120
* @param array $headers
121+
*
122122
* @return Request
123123
*/
124124
protected function createRequest($method, $endpoint, $body = null, array $headers = [])
@@ -132,12 +132,13 @@ protected function createRequest($method, $endpoint, $body = null, array $header
132132
* Send an HTTP request.
133133
*
134134
* @param RequestInterface $request
135+
*
135136
* @return array
136137
*/
137138
protected function sendRequest(RequestInterface $request)
138139
{
139140
$response = $this->client->send($request);
140-
/** @var \Psr\Http\Message\ResponseInterface $response */
141+
/* @var \Psr\Http\Message\ResponseInterface $response */
141142

142143
return json_decode($response->getBody(), true);
143144
}
@@ -147,6 +148,7 @@ protected function sendRequest(RequestInterface $request)
147148
*
148149
* @param string $endpoint
149150
* @param array $data
151+
*
150152
* @return mixed
151153
*/
152154
public function post($endpoint, array $data = [])
@@ -188,4 +190,4 @@ public function publishBatch($channel, array $messages)
188190
{
189191
$this->post(sprintf('messages/%s', $channel), ['messages' => $messages]);
190192
}
191-
}
193+
}

tests/HTTPPubSubAdapterTest.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function testPost()
8282
'POST',
8383
'messages/test',
8484
json_encode(['messages' => ['hello', 'world']]),
85-
['Content-Type' => 'application/json']
85+
['Content-Type' => 'application/json'],
8686
])
8787
->once()
8888
->andReturn($request);
@@ -103,7 +103,7 @@ public function testSubscribe()
103103
$subscribeAdapter->shouldReceive('subscribe')
104104
->withArgs([
105105
'test',
106-
$handler
106+
$handler,
107107
])
108108
->once();
109109

@@ -127,9 +127,9 @@ public function testPublish()
127127
'messages' => [
128128
[
129129
'hello' => 'world',
130-
]
130+
],
131131
],
132-
]
132+
],
133133
])
134134
->once();
135135
$adapter->publish('test', ['hello' => 'world']);
@@ -151,17 +151,17 @@ public function testPublishBatch()
151151
'test',
152152
[
153153
'hello' => 'world',
154-
]
154+
],
155155
],
156-
]
156+
],
157157
])
158158
->once();
159159
$messages = [
160160
'test',
161161
[
162162
'hello' => 'world',
163-
]
163+
],
164164
];
165165
$adapter->publishBatch('test', $messages);
166166
}
167-
}
167+
}

0 commit comments

Comments
 (0)