diff --git a/src/Client.php b/src/Client.php index defb780..17badc0 100644 --- a/src/Client.php +++ b/src/Client.php @@ -85,24 +85,23 @@ class Client bool $json = true ): ?array { - $response = curl_exec( - $this->_curl - ); + if ($response = curl_exec($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 ); - $errorText = curl_error( + return curl_error( $this->_curl ); - - if ($response) - { - return $json ? json_decode($response, true) : $response; - } - - return null; } public function getBlockCount(): ?int