Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Nov 15, 2023
1 parent f752a13 commit 3c74c8f
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions src/Controllers/AbstractOAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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());
}

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

0 comments on commit 3c74c8f

Please sign in to comment.