protected function saveCurrentAccessTokenToFile(string $tokenFilePath)
    {
        $this->logger->info('Saving the access token to the `'.$tokenFilePath.'` file');

        $token = $this->client->getAccessToken();
        if ($token === null) {
            throw new \LogicException('Can\'t save the token because the current Google client doesn\'t have an access token');
        }

        try {
            $this->saveCredentialJSON($tokenFilePath, $token);
        } catch (\RuntimeException $exception) {
            throw new \RuntimeException('Failed to save the access token: '.$exception->getMessage());
        }
    }
protected function saveCurrentAccessTokenToFile(string $tokenFilePath)
    {
        $this->logger->info('Saving the access token to the `'.$tokenFilePath.'` file');

        $token = $this->client->getAccessToken();
        if ($token === null) {
            throw new \LogicException('Can\'t save the token because the current Google client doesn\'t have an access token');
        }

        try {
            $this->saveCredentialJSON($tokenFilePath, $token);
        } catch (\RuntimeException $exception) {
            throw new \RuntimeException('Failed to save the access token: '.$exception->getMessage());
        }
    }
protected function saveCurrentAccessTokenToFile ( string $ tokenFilePath ) { $ this -> logger -> info ( 'Saving the access token to the `' . $ tokenFilePath . '` file' ) ; $ token = $ this -> client -> getAccessToken ( ) ; if ( $ token === null ) { throw new \ LogicException ( 'Can\'t save the token because the current Google client doesn\'t have an access token' ) ; } try { $ this -> saveCredentialJSON ( $ tokenFilePath , $ token ) ; } catch ( \ RuntimeException $ exception ) { throw new \ RuntimeException ( 'Failed to save the access token: ' . $ exception -> getMessage ( ) ) ; } }
Saves the current access token to file

@param string $tokenFilePath Path to the file
@throws \RuntimeException If file saving fails
@throws \LogicException If the client doesn't have a token
Saves the current access token to file