protected function loadAccessTokenFromFile(string $filePath)
    {
        $this->logger->info('Getting the last Google API access token from the `'.$filePath.'` file');

        try {
            $tokenData = $this->loadCredentialJSON($filePath);
        } catch (\RuntimeException $exception) {
            throw new \RuntimeException('Couldn\'t parse the access token file: '.$exception->getMessage());
        }

        try {
            $this->client->setAccessToken($tokenData);
        } catch (\Exception $exception) {
            throw new \RuntimeException('Failed to set the access token from file `'.$filePath.'` to Google SDK: '.$exception->getMessage());
        }
    }
protected function loadAccessTokenFromFile(string $filePath)
    {
        $this->logger->info('Getting the last Google API access token from the `'.$filePath.'` file');

        try {
            $tokenData = $this->loadCredentialJSON($filePath);
        } catch (\RuntimeException $exception) {
            throw new \RuntimeException('Couldn\'t parse the access token file: '.$exception->getMessage());
        }

        try {
            $this->client->setAccessToken($tokenData);
        } catch (\Exception $exception) {
            throw new \RuntimeException('Failed to set the access token from file `'.$filePath.'` to Google SDK: '.$exception->getMessage());
        }
    }
protected function loadAccessTokenFromFile ( string $ filePath ) { $ this -> logger -> info ( 'Getting the last Google API access token from the `' . $ filePath . '` file' ) ; try { $ tokenData = $ this -> loadCredentialJSON ( $ filePath ) ; } catch ( \ RuntimeException $ exception ) { throw new \ RuntimeException ( 'Couldn\'t parse the access token file: ' . $ exception -> getMessage ( ) ) ; } try { $ this -> client -> setAccessToken ( $ tokenData ) ; } catch ( \ Exception $ exception ) { throw new \ RuntimeException ( 'Failed to set the access token from file `' . $ filePath . '` to Google SDK: ' . $ exception -> getMessage ( ) ) ; } }
Loads an access token from file to Google Client

@param string $filePath Path to the file
@throws \RuntimeException If the authentication failed
Loads an access token from file to Google Client