From 56fd28ed36522a3067008078b839eec9e0a8f8f8 Mon Sep 17 00:00:00 2001 From: Adrian Date: Thu, 21 Sep 2017 22:34:32 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/FactomConnector.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/FactomConnector.php b/src/FactomConnector.php index 86dd5c0..b3645ea 100644 --- a/src/FactomConnector.php +++ b/src/FactomConnector.php @@ -4,8 +4,6 @@ use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Psr7\Request; - use AdrianMejias\FactomApi\Exceptions\InvalidFactomApiConfig; class FactomConnector @@ -16,11 +14,11 @@ class FactomConnector * @var string */ const JSON_RPC = '2.0'; - + /** * The "ID" param provided in all requests to the API. * - * @var integer + * @var int */ const REQUEST_ID = 0; @@ -30,14 +28,14 @@ class FactomConnector * @var string */ const HEADER_CONTENT_TYPE = 'text/plain'; - + /** * The header accept in all requests to the API. * * @var string */ const HEADER_ACCEPT = 'application/json'; - + /** * The generic error if cannot load server properly. * @@ -161,13 +159,13 @@ public function callEndpoint(string $action, string $method, array $params = [], // Append certificate verification // if ($this->ssl) { - // $options['verify'] = $this->certificate; - // $options['cert'] = [ - // 'cert' => [ - // $this->certificate, - // $this->password - // ], - // ]; + // $options['verify'] = $this->certificate; + // $options['cert'] = [ + // 'cert' => [ + // $this->certificate, + // $this->password + // ], + // ]; // } // Append authentication to params @@ -184,11 +182,11 @@ public function callEndpoint(string $action, string $method, array $params = [], // Make the call to factom server try { $response = $this->client->{strtolower($method)}($this->url, $options); - } catch(RequestException $e) { + } catch (RequestException $e) { $error = $e->getMessage(); } - if (!empty($error)) { + if (! empty($error)) { throw InvalidFactomApiConfig::invalidApiResponse($error, $action); }