Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6 from adrianmejias/analysis-8QdW6o
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
adrianmejias committed Sep 21, 2017
2 parents 8e39f92 + 56fd28e commit 613543f
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/FactomConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Request;

use AdrianMejias\FactomApi\Exceptions\InvalidFactomApiConfig;

class FactomConnector
Expand All @@ -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;

Expand All @@ -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.
*
Expand Down Expand Up @@ -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
Expand All @@ -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);
}

Expand Down

0 comments on commit 613543f

Please sign in to comment.