From 3c74c8f4999653fc03cdaa5f28c26d1763da76b1 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 15 Nov 2023 13:38:01 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Controllers/AbstractOAuthController.php | 37 ++++++++++++--------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/Controllers/AbstractOAuthController.php b/src/Controllers/AbstractOAuthController.php index 860a455..55e279f 100644 --- a/src/Controllers/AbstractOAuthController.php +++ b/src/Controllers/AbstractOAuthController.php @@ -55,7 +55,7 @@ abstract class AbstractOAuthController implements RequestHandlerInterface /** * How long to cache OAuth data for in seconds. */ - static $OAUTH_DATA_CACHE_LIFETIME = 60 * 5; // 5 minutes + public static $OAUTH_DATA_CACHE_LIFETIME = 60 * 5; // 5 minutes /** * @var ResponseFactory @@ -214,7 +214,7 @@ protected function redirectToAuthorizationUrl(AbstractProvider $provider, Store $this->put(self::SESSION_OAUTH2STATE, $provider->getState(), $session); - return new RedirectResponse($authUrl . '&display=' . $this->getDisplayType()); + return new RedirectResponse($authUrl.'&display='.$this->getDisplayType()); } /** @@ -363,7 +363,6 @@ function (Registration $registration) use ($resourceOwner, $token) { return $response; } - public static function setAfterOAuthSuccessCallbacks(array $callbacks) { static::$afterOAuthSuccessCallbacks = array_merge(static::$afterOAuthSuccessCallbacks, $callbacks); @@ -420,9 +419,10 @@ abstract protected function setSuggestions(Registration $registration, $user, st * Store data in cache for the default amount of time. * * @param string $key - * @param mixed $value - * @param Store $session - * @return boolean + * @param mixed $value + * @param Store $session + * + * @return bool */ protected function put(string $key, $value, Store $session): bool { @@ -433,9 +433,10 @@ protected function put(string $key, $value, Store $session): bool * Store data in cache indefinitely. * * @param string $key - * @param mixed $value - * @param Store $session - * @return boolean + * @param mixed $value + * @param Store $session + * + * @return bool */ protected function putForever(string $key, $value, Store $session): bool { @@ -446,7 +447,8 @@ protected function putForever(string $key, $value, Store $session): bool * Get data from cache. * * @param string $key - * @param Store $session + * @param Store $session + * * @return mixed|null */ protected function get(string $key, Store $session) @@ -458,8 +460,9 @@ protected function get(string $key, Store $session) * Remove data from the cache. * * @param string $key - * @param Store $session - * @return boolean + * @param Store $session + * + * @return bool */ protected function forget(string $key, Store $session): bool { @@ -470,19 +473,21 @@ protected function forget(string $key, Store $session): bool * Check if a key exists in the cache. * * @param string $key - * @param Store $session - * @return boolean + * @param Store $session + * + * @return bool */ protected function has(string $key, Store $session): bool { - return !!$this->cache->get($this->buildKey($key, $session)); + return (bool) $this->cache->get($this->buildKey($key, $session)); } /** * Build the cache store key. * * @param string $key - * @param Store $session + * @param Store $session + * * @return string */ protected function buildKey(string $key, Store $session): string