src/AbstractAccessToken.php
public function getToken($forceRefresh = false)
    {
        $cached = $this->getCache()->fetch($this->getCacheKey()) ?: $this->token;

        if ($forceRefresh || empty($cached)) {

            $result = $this->getTokenFromServer();

            $this->checkTokenResponse($result);

            $this->setToken(
                $token = $result[$this->tokenJsonKey],
                $this->expiresJsonKey ? $result[$this->expiresJsonKey] : null
            );

            return $token;
        }

        return $cached;
    }
public function getToken($forceRefresh = false)
    {
        $cached = $this->getCache()->fetch($this->getCacheKey()) ?: $this->token;

        if ($forceRefresh || empty($cached)) {

            $result = $this->getTokenFromServer();

            $this->checkTokenResponse($result);

            $this->setToken(
                $token = $result[$this->tokenJsonKey],
                $this->expiresJsonKey ? $result[$this->expiresJsonKey] : null
            );

            return $token;
        }

        return $cached;
    }
public function getToken ( $ forceRefresh = false ) { $ cached = $ this -> getCache ( ) -> fetch ( $ this -> getCacheKey ( ) ) ? : $ this -> token ; if ( $ forceRefresh || empty ( $ cached ) ) { $ result = $ this -> getTokenFromServer ( ) ; $ this -> checkTokenResponse ( $ result ) ; $ this -> setToken ( $ token = $ result [ $ this -> tokenJsonKey ] , $ this -> expiresJsonKey ? $ result [ $ this -> expiresJsonKey ] : null ) ; return $ token ; } return $ cached ; }
Get token from cache.

@param bool $forceRefresh

@return string
Get token from cache .