Skip to content

Commit 8ecf5f7

Browse files
committed
fix returned data structure
1 parent 976552d commit 8ecf5f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/SpotifyTokenSwapper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public function __construct($config)
2828
/**
2929
* Swap an auth code for an access token & a refresh token
3030
* @param {String} $authCode The auth code as provided by the Spotify API
31-
*
32-
* @return {Array} An array containing the 'access_token', 'token_type',
31+
*
32+
* @return {Array} An array containing the 'access_token', 'token_type',
3333
* 'expires_in', 'refresh_token' and 'scope' fields
3434
*/
3535
public function swapAuthCode($authCode)
3636
{
3737
$ch = curl_init("https://accounts.spotify.com/api/token");
38-
38+
3939
// Uses POST verb
4040
curl_setopt($ch, CURLOPT_POST, 1);
4141

@@ -55,6 +55,6 @@ public function swapAuthCode($authCode)
5555
$response = curl_exec($ch);
5656
curl_close($ch);
5757

58-
return json_decode($response);
58+
return json_decode($response, true);
5959
}
60-
}
60+
}

0 commit comments

Comments
 (0)