diff --git a/src/Cache/Cache.php b/src/Cache/Cache.php index 2170034..af0bb0f 100644 --- a/src/Cache/Cache.php +++ b/src/Cache/Cache.php @@ -2,7 +2,7 @@ /** * User: marcus-campos * Date: 24/10/17 - * Time: 12:33 + * Time: 12:33. */ namespace Maestro\Cache; @@ -57,7 +57,7 @@ public function cachable(int $time = 60) private function fetchCachedIfExists() { // Generate a key to use for caching - $this->cacheKey = md5($this->url . $this->endPoint); + $this->cacheKey = md5($this->url.$this->endPoint); // Set the response from APCu cache if (apcu_exists($this->cacheKey)) { @@ -85,15 +85,15 @@ private function makeCacheExpiryTime(): int private function cacheResponseBody() { if (method_exists($this->response, 'getBody')) { - $this->responseBody = (string)$this->response->getBody(); + $this->responseBody = (string) $this->response->getBody(); } if ($this->cachingEnabled && $this->response->getReasonPhrase() === 'OK') { $batch = [ - 'expires' => $this->makeCacheExpiryTime(), + 'expires' => $this->makeCacheExpiryTime(), 'responseBody' => $this->responseBody, ]; apcu_store($this->cacheKey, $batch); } } -} \ No newline at end of file +} diff --git a/src/Rest.php b/src/Rest.php index 24c259c..9c38923 100644 --- a/src/Rest.php +++ b/src/Rest.php @@ -146,7 +146,6 @@ public function body(array $body) return $this; } - /** * Either sends the request or fetches a cached response body dependent on if caching is enabled. * @@ -220,7 +219,7 @@ function ($response) { private function newRequest() { // GET method doesn't send a BODY - $paramsToSend = [$this->method, $this->url . $this->endPoint, $this->headers]; + $paramsToSend = [$this->method, $this->url.$this->endPoint, $this->headers]; if ($this->method !== 'GET') { $paramsToSend[] = $this->body; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 179ab28..86c0432 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -5,6 +5,6 @@ * Add additional configuration/setup your application needs when running * unit tests in this file. */ -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor/autoload.php'; +require_once dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor/autoload.php'; $_SERVER['PHP_SELF'] = '/';