diff --git a/README.md b/README.md index 0a6c7ba..2e6a319 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Installation is possible using Composer. If you don't already use Composer, you can download the composer.phar binary: ```bash -curl -sS https://getcomposer.org/installer | php +> curl -sS https://getcomposer.org/installer | php ``` Then install the library: @@ -35,7 +35,7 @@ Use the Ripple $address = ""; $secret_key = ""; -$ripple = new \IEXBase\RippleAPI\Ripple(string $address, string $secret_key = ""); +$ripple = new \IEXBase\RippleAPI\Ripple($address, $secret_key = ""); //$account = $ripple->getAccount(); //dump($account); diff --git a/src/RippleClient.php b/src/RippleClient.php index 988a09c..2e295c8 100644 --- a/src/RippleClient.php +++ b/src/RippleClient.php @@ -22,21 +22,21 @@ class RippleClient * * @var string */ - protected $WSSNode; + protected string $WSSNode; /** * Guzzle Http Client * * @var Client */ - protected $client; + protected Client $client; /** * Number of requests * - * @var integer + * @var int */ - protected $requestCount = 0; + protected int $requestCount = 0; /** * Create a new RippleClient object @@ -87,8 +87,8 @@ public function sendRequest($method, $path, $options = [], $api = true) } return $this->toArray($response->getBody()->getContents()); - } catch (GuzzleException $e) { - die($e->getMessage()); + } catch (GuzzleException $exception) { + return ['result' => 'error', 'message' => $exception->getMessage()]; } } @@ -109,8 +109,8 @@ public function sendRequestWss($method, $path, $options = []) $response = $this->client->request($method, $url, ['query' => $options]); return $this->toArray($response->getBody()->getContents()); - } catch (GuzzleException $e) { - die($e->getMessage()); + } catch (GuzzleException $exception) { + return ['result' => 'error', 'message' => $exception->getMessage()]; } }