Skip to content

Commit

Permalink
Create a new google client for handling the broadcast loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin de Keijzer committed Apr 30, 2020
1 parent 46f2883 commit eeb265d
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions Service/ChannelApi/Client/GoogleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ class GoogleClient
*/
protected $logger;

/**
* @var \Google_Client|null
*/
protected $googleClient;

/**
* GoogleClient constructor.
*
Expand All @@ -61,20 +56,6 @@ public function __construct(GoogleConfig $config, GoogleRedirectService $redirec
* @throws \Martin1982\LiveBroadcastBundle\Exception\LiveBroadcastOutputException
*/
public function getClient(): \Google_Client
{
if (!$this->googleClient instanceof \Google_Client) {
$this->setupClient();
}

return $this->googleClient;
}

/**
* Setup the Google API client
*
* @throws \Martin1982\LiveBroadcastBundle\Exception\LiveBroadcastOutputException
*/
protected function setupClient(): void
{
$client = new \Google_Client();
$client->setLogger($this->logger);
Expand All @@ -85,6 +66,6 @@ protected function setupClient(): void
$client->setRedirectUri($this->redirect->getOAuthRedirectUrl());
$client->setApprovalPrompt('force');

$this->googleClient = $client;
return $client;
}
}

0 comments on commit eeb265d

Please sign in to comment.