1 | <?php |
||
27 | class Deezer extends AbstractService |
||
28 | { |
||
29 | /** |
||
30 | * Defined scopes |
||
31 | * http://developers.deezer.com/api/permissions |
||
32 | */ |
||
33 | const SCOPE_BASIC_ACCESS = 'basic_access'; // Access users basic information |
||
34 | const SCOPE_EMAIL = 'email'; // Get the user's email |
||
35 | const SCOPE_OFFLINE_ACCESS = 'offline_access'; // Access user data any time |
||
36 | const SCOPE_MANAGE_LIBRARY = 'manage_library'; // Manage users' library |
||
37 | const SCOPE_MANAGE_COMMUNITY = 'manage_community'; // Manage users' friends |
||
38 | const SCOPE_DELETE_LIBRARY = 'delete_library'; // Delete library items |
||
39 | const SCOPE_LISTENING_HISTORY = 'listening_history'; // Access the user's listening history |
||
40 | |||
41 | public function __construct( |
||
42 | CredentialsInterface $credentials, |
||
43 | ClientInterface $httpClient, |
||
44 | TokenStorageInterface $storage, |
||
45 | $scopes = array(), |
||
46 | UriInterface $baseApiUri = null |
||
47 | ) { |
||
48 | parent::__construct( |
||
49 | $credentials, |
||
50 | $httpClient, |
||
51 | $storage, |
||
52 | $scopes, |
||
53 | $baseApiUri, |
||
54 | true |
||
55 | ); |
||
56 | |||
57 | if (null === $baseApiUri) { |
||
58 | $this->baseApiUri = new Uri('https://api.deezer.com/'); |
||
59 | } |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function getAuthorizationEndpoint() |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function getAccessTokenEndpoint() |
||
77 | |||
78 | /** |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | protected function getAuthorizationMethod() |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | protected function parseAccessTokenResponse($responseBody) |
||
121 | } |
||
122 |