Merge branch 'master' of https://git.mcnd.ca/mcndave/negundo-client
This commit is contained in:
commit
a552a6675e
6 files changed
+16
-10
No files matched your search
@@ -10,7 +10,7 @@ class Curl implements TransportInterface {
|
||||
|
||||
public $headers = [];
|
||||
|
||||
public function push(string $url, array $data) : ? object
|
||||
public function push(string $url, array $data) : object|null|bool
|
||||
{
|
||||
$ch = curl_init();
|
||||
|
||||
@@ -22,7 +22,9 @@ class Curl implements TransportInterface {
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT_MS, $this->timeout * 200);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
if ( ( false === curl_exec($ch) ) && $this->throwErrors ) {
|
||||
$exec = curl_exec($ch);
|
||||
|
||||
if ( ( false === $exec ) && $this->throwErrors ) {
|
||||
$errno = curl_errno($ch);
|
||||
$errors = array_filter([ curl_error($ch) , static::CURL_ERROR[$errno] ?? null ]);
|
||||
|
||||
@@ -31,7 +33,7 @@ class Curl implements TransportInterface {
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
return null;
|
||||
return $exec;
|
||||
}
|
||||
|
||||
const CURL_ERROR = [
|
||||
|
||||
Reference in new issue
Block a user