Skip to content
This repository was archived by the owner on Aug 27, 2023. It is now read-only.

Commit fe0848f

Browse files
authored
Merge branch 'master' into feature/video-update
2 parents 1f6f358 + 6a9461c commit fe0848f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Youtube.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __construct($app, Google_Client $client)
7676
* @param string $path
7777
* @param array $data
7878
* @param string $privacyStatus
79-
* @return string
79+
* @return self
8080
* @throws Exception
8181
*/
8282
public function upload($path, array $data = [], $privacyStatus = 'public')
@@ -146,7 +146,7 @@ public function upload($path, array $data = [], $privacyStatus = 'public')
146146
* @param string $id
147147
* @param array $data
148148
* @param string $privacyStatus
149-
* @return string
149+
* @return self
150150
* @throws Exception
151151
*/
152152
public function update($id, array $data = [], $privacyStatus = 'public')
@@ -395,13 +395,11 @@ public function handleAccessToken()
395395

396396
if($this->client->isAccessTokenExpired())
397397
{
398-
$accessToken = json_decode($accessToken);
399-
400398
// If we have a "refresh_token"
401-
if(property_exists($accessToken, 'refresh_token'))
399+
if (array_key_exists('refresh_token', $accessToken))
402400
{
403401
// Refresh the access token
404-
$this->client->refreshToken($accessToken->refresh_token);
402+
$this->client->refreshToken($accessToken['refresh_token']);
405403

406404
// Save the access token
407405
$this->saveAccessTokenToDB($this->client->getAccessToken());

0 commit comments

Comments
 (0)