Skip to content

Commit 26a3341

Browse files
authored
Merge pull request #89 from mikealmond/hotfix/adhere-to-interface
Make AbstractRequest adhere to the RequestInterface
2 parents f2857b7 + 480b1a3 commit 26a3341

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/Message/AbstractRequest.php

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -183,22 +183,6 @@ public function getHeaders()
183183
return $headers;
184184
}
185185

186-
/**
187-
* Send the request
188-
*
189-
* @return ResponseInterface
190-
*/
191-
public function send()
192-
{
193-
$data = $this->getData();
194-
$headers = array_merge(
195-
$this->getHeaders(),
196-
array('Authorization' => 'Basic ' . base64_encode($this->getApiKey() . ':'))
197-
);
198-
199-
return $this->sendData($data, $headers);
200-
}
201-
202186
/**
203187
* @param $data
204188
* @param array $headers
@@ -234,8 +218,16 @@ function ($event) {
234218
return $httpRequest;
235219
}
236220

237-
public function sendData($data, array $headers = null)
221+
/**
222+
* {@inheritdoc}
223+
*/
224+
public function sendData($data)
238225
{
226+
$headers = array_merge(
227+
$this->getHeaders(),
228+
array('Authorization' => 'Basic ' . base64_encode($this->getApiKey() . ':'))
229+
);
230+
239231
$httpRequest = $this->createClientRequest($data, $headers);
240232
$httpResponse = $httpRequest->send();
241233

0 commit comments

Comments
 (0)