1 | <?php |
||
13 | class Spotify extends AbstractService |
||
14 | { |
||
15 | /** |
||
16 | * Scopes |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | const SCOPE_PLAYLIST_MODIFY_PUBLIC = 'playlist-modify-public'; |
||
21 | const SCOPE_PLAYLIST_MODIFY_PRIVATE = 'playlist-modify-private'; |
||
22 | const SCOPE_PLAYLIST_READ_PRIVATE = 'playlist-read-private'; |
||
23 | const SCOPE_PLAYLIST_READ_COLABORATIVE = 'playlist-read-collaborative'; |
||
24 | const SCOPE_STREAMING = 'streaming'; |
||
25 | const SCOPE_USER_LIBRARY_MODIFY = 'user-library-modify'; |
||
26 | const SCOPE_USER_LIBRARY_READ = 'user-library-read'; |
||
27 | const SCOPE_USER_READ_PRIVATE = 'user-read-private'; |
||
28 | const SCOPE_USER_READ_EMAIL = 'user-read-email'; |
||
29 | const SCOPE_USER_READ_BIRTHDAY = 'user-read-birthdate'; |
||
30 | const SCOPE_USER_READ_FOLLOW = 'user-follow-read'; |
||
31 | |||
32 | public function __construct( |
||
33 | CredentialsInterface $credentials, |
||
34 | ClientInterface $httpClient, |
||
35 | TokenStorageInterface $storage, |
||
36 | $scopes = array(), |
||
37 | UriInterface $baseApiUri = null |
||
38 | ) { |
||
39 | parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, true); |
||
40 | |||
41 | if (null === $baseApiUri) { |
||
42 | $this->baseApiUri = new Uri('https://api.spotify.com/v1/'); |
||
43 | } |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function getAuthorizationEndpoint() |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function getAccessTokenEndpoint() |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | protected function getAuthorizationMethod() |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | protected function parseAccessTokenResponse($responseBody) |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | protected function getExtraOAuthHeaders() |
||
112 | } |
||
113 |