From 6f1187b1f0b147d7c498dcb5fb6435b7ddf7603b Mon Sep 17 00:00:00 2001 From: codescheme Date: Mon, 20 Feb 2017 08:51:59 +0000 Subject: [PATCH] fix indent --- src/Classes/Postcode.php | 49 +++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/src/Classes/Postcode.php b/src/Classes/Postcode.php index 7652224..db4ebcb 100644 --- a/src/Classes/Postcode.php +++ b/src/Classes/Postcode.php @@ -37,7 +37,12 @@ public function __construct() 'Accept' => 'application/json', ]; - $this->client = new Client(['base_uri' => $this->base_uri, 'headers' => $this->headers, 'http_errors' => false, 'verify' => __DIR__ . '/../cacert.pem']); + $this->client = new Client([ + 'base_uri' => $this->base_uri, + 'headers' => $this->headers, + 'http_errors' => false, + 'verify' => __DIR__ . '/../cacert.pem' + ]); } /** @@ -52,14 +57,14 @@ public function validate($postcode) $request = new Request('GET', $url); $response = $this->httpTransport($request); - return ($response && (200 === $response->status) && $response->result); + return ($response && (200 === $response->status) && $response->result); } /** * Find nearest postcodes to given * - * @param string $postcode - * @return object | null on Exception + * @param string $postcode + * @return object | null on Exception */ public function nearest($postcode) { @@ -73,7 +78,7 @@ public function nearest($postcode) * Get postcode from coordinates * * @params string $lon, $lat the coordinates - * @return object | null on Exception + * @return object | null on Exception */ public function reverseGeocode($lon, $lat) { @@ -84,10 +89,10 @@ public function reverseGeocode($lon, $lat) } /** - * Autocomplete a postcode, + * Autocomplete a postcode, * - * @param string $postcode, partial, especially outcode - * @return object | null on Exception + * @param string $postcode, partial, especially outcode + * @return object | null on Exception */ public function autocomplete($postcode) { @@ -98,10 +103,10 @@ public function autocomplete($postcode) } /** - * Look up a postcode, + * Look up a postcode, * - * @param string $postcode, - * @return object | null on Exception + * @param string $postcode, + * @return object | null on Exception */ public function postcodeLookup($postcode) { @@ -112,10 +117,10 @@ public function postcodeLookup($postcode) } /** - * Look up a outcode, + * Look up a outcode, * - * @param string $outcode, - * @return object | null on Exception + * @param string $outcode, + * @return object | null on Exception */ public function outcodeLookup($outcode) { @@ -123,13 +128,13 @@ public function outcodeLookup($outcode) $request = new Request('GET', $url); return $this->httpTransport($request); - } + } /** * Bulk information lookup for multiple postcodes * - * @param array $postcodes - * @return object | null on RequestException + * @param array $postcodes + * @return object | null on RequestException */ public function postcodeLookupBulk($postcodes) { @@ -167,12 +172,10 @@ public function reverseGeocodeBulk($geolocations) protected function httpTransport($request) { - try { - $response = $this->client->send($request); - $results = json_decode($response->getBody()); - - return $results; - + try { + $response = $this->client->send($request); + $results = json_decode($response->getBody()); + return $results; } catch (RequestException $e) { Log::error(Psr7\str($e->getRequest())); if ($e->hasResponse()) {