|
|
@ -85,24 +85,23 @@ class Client |
|
|
|
bool $json = true |
|
|
|
bool $json = true |
|
|
|
): ?array |
|
|
|
): ?array |
|
|
|
{ |
|
|
|
{ |
|
|
|
$response = curl_exec( |
|
|
|
if ($response = curl_exec($this->_curl)) |
|
|
|
$this->_curl |
|
|
|
{ |
|
|
|
); |
|
|
|
return $json ? json_decode($response, true) : $response; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$errorNumber = curl_errno( |
|
|
|
public function getError(?int &$code = null): mixed |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$code = curl_errno( |
|
|
|
$this->_curl |
|
|
|
$this->_curl |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$errorText = curl_error( |
|
|
|
return curl_error( |
|
|
|
$this->_curl |
|
|
|
$this->_curl |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if ($response) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return $json ? json_decode($response, true) : $response; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getBlockCount(): ?int |
|
|
|
public function getBlockCount(): ?int |
|
|
|