@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param array $options |
38 | 38 | * @return bool |
39 | 39 | */ |
40 | - public function addPlaylistTracks($playlistId, array $tracks, array $options = []): bool |
|
40 | + public function addPlaylistTracks($playlistId, array $tracks, array $options = [ ]): bool |
|
41 | 41 | { |
42 | 42 | return $this->baseSpotifyWebAPI->addPlaylistTracks($playlistId, $tracks, $options); |
43 | 43 | } |
@@ -49,18 +49,18 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function deletePlaylistTracks(string $playlistId, array $tracksInfo): bool |
51 | 51 | { |
52 | - $tracksToDelete = []; |
|
52 | + $tracksToDelete = [ ]; |
|
53 | 53 | foreach ($tracksInfo as $deleteTrackInfoDataProvider) { |
54 | 54 | if (!$deleteTrackInfoDataProvider instanceof DeleteTrackInfoDataProvider) { |
55 | 55 | throw new \RuntimeException( |
56 | 56 | sprintf(Message::ERROR_DELETE_PLAYLIST_TRACKS, DeleteTrackInfoDataProvider::class) |
57 | 57 | ); |
58 | 58 | } |
59 | - $tracksToDelete[] = $deleteTrackInfoDataProvider->toArray(); |
|
59 | + $tracksToDelete[ ] = $deleteTrackInfoDataProvider->toArray(); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $this->baseSpotifyWebAPI->setReturnType(Request::RETURN_OBJECT); |
63 | - $delete = (bool)$this->baseSpotifyWebAPI->deletePlaylistTracks($playlistId, $tracksToDelete); |
|
63 | + $delete = (bool) $this->baseSpotifyWebAPI->deletePlaylistTracks($playlistId, $tracksToDelete); |
|
64 | 64 | $this->baseSpotifyWebAPI->setReturnType(Request::RETURN_ASSOC); |
65 | 65 | |
66 | 66 | return $delete; |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | * @param array $options |
72 | 72 | * @return PlaylistDataProvider |
73 | 73 | */ |
74 | - public function getPlaylist(string $playlistId, array $options = []): PlaylistDataProvider |
|
74 | + public function getPlaylist(string $playlistId, array $options = [ ]): PlaylistDataProvider |
|
75 | 75 | { |
76 | - $jsonObjectResult = (array)$this->baseSpotifyWebAPI->getPlaylist($playlistId, $options); |
|
76 | + $jsonObjectResult = (array) $this->baseSpotifyWebAPI->getPlaylist($playlistId, $options); |
|
77 | 77 | |
78 | 78 | $playlistDataProvider = new PlaylistDataProvider(); |
79 | 79 | $playlistDataProvider->fromArray($jsonObjectResult); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @return PlaylistDataProvider |
89 | 89 | * @throws PlaylistNotFound |
90 | 90 | */ |
91 | - public function getUserPlaylistByName(string $userId, string $playlistName, array $options = []): PlaylistDataProvider |
|
91 | + public function getUserPlaylistByName(string $userId, string $playlistName, array $options = [ ]): PlaylistDataProvider |
|
92 | 92 | { |
93 | 93 | $userPlaylistsDataProvider = $this->getUserPlaylists($userId, $options); |
94 | 94 | $playlists = $userPlaylistsDataProvider->getItems(); |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | * @param array $options |
107 | 107 | * @return PlaylistTracksDataProvider |
108 | 108 | */ |
109 | - public function getPlaylistTracks(string $playlistId, array $options = []): PlaylistTracksDataProvider |
|
109 | + public function getPlaylistTracks(string $playlistId, array $options = [ ]): PlaylistTracksDataProvider |
|
110 | 110 | { |
111 | - $jsonObjectResult = (array)$this->baseSpotifyWebAPI->getPlaylistTracks($playlistId, $options); |
|
111 | + $jsonObjectResult = (array) $this->baseSpotifyWebAPI->getPlaylistTracks($playlistId, $options); |
|
112 | 112 | |
113 | 113 | $playlistTracksDataProvider = new PlaylistTracksDataProvider(); |
114 | 114 | $playlistTracksDataProvider->fromArray($jsonObjectResult); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @param array $options |
122 | 122 | * @return TracksSearchDataProvider |
123 | 123 | */ |
124 | - public function searchTrack(TrackSearchRequestDataProvider $trackSearchRequest, array $options = []): TracksSearchDataProvider |
|
124 | + public function searchTrack(TrackSearchRequestDataProvider $trackSearchRequest, array $options = [ ]): TracksSearchDataProvider |
|
125 | 125 | { |
126 | 126 | $jsonObjectResult = $this->search( |
127 | 127 | sprintf( |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ); |
136 | 136 | |
137 | 137 | $tracksSearchDataProvider = new TracksSearchDataProvider(); |
138 | - $tracksSearchDataProvider->fromArray($jsonObjectResult[$trackSearchRequest->getResultType()]); |
|
138 | + $tracksSearchDataProvider->fromArray($jsonObjectResult[ $trackSearchRequest->getResultType() ]); |
|
139 | 139 | |
140 | 140 | return $tracksSearchDataProvider; |
141 | 141 | } |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | * @param array $options |
147 | 147 | * @return array |
148 | 148 | */ |
149 | - private function search(string $query, array $type, array $options = []): array |
|
149 | + private function search(string $query, array $type, array $options = [ ]): array |
|
150 | 150 | { |
151 | - return (array)$this->baseSpotifyWebAPI->search($query, $type, $options); |
|
151 | + return (array) $this->baseSpotifyWebAPI->search($query, $type, $options); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | * @param array $options |
157 | 157 | * @return UserPlaylistsDataProvider |
158 | 158 | */ |
159 | - private function getUserPlaylists(string $userId, array $options = []): UserPlaylistsDataProvider |
|
159 | + private function getUserPlaylists(string $userId, array $options = [ ]): UserPlaylistsDataProvider |
|
160 | 160 | { |
161 | - $userPlaylistInfo = (array)$this->baseSpotifyWebAPI->getUserPlaylists($userId, $options); |
|
161 | + $userPlaylistInfo = (array) $this->baseSpotifyWebAPI->getUserPlaylists($userId, $options); |
|
162 | 162 | |
163 | 163 | $userPlaylistsDataProvider = new UserPlaylistsDataProvider(); |
164 | 164 | $userPlaylistsDataProvider->fromArray($userPlaylistInfo); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @param array $options |
17 | 17 | * @return bool |
18 | 18 | */ |
19 | - public function addPlaylistTracks($playlistId, array $tracks, array $options = []): bool; |
|
19 | + public function addPlaylistTracks($playlistId, array $tracks, array $options = [ ]): bool; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @param string $playlistId |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | * @param array $options |
31 | 31 | * @return PlaylistDataProvider |
32 | 32 | */ |
33 | - public function getPlaylist(string $playlistId, array $options = []): PlaylistDataProvider; |
|
33 | + public function getPlaylist(string $playlistId, array $options = [ ]): PlaylistDataProvider; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @param $playlistId |
37 | 37 | * @param array $options |
38 | 38 | * @return object |
39 | 39 | */ |
40 | - public function getPlaylistTracks(string $playlistId, array $options = []); |
|
40 | + public function getPlaylistTracks(string $playlistId, array $options = [ ]); |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @param string $userId |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | * @return PlaylistDataProvider |
47 | 47 | * @throws PlaylistNotFound |
48 | 48 | */ |
49 | - public function getUserPlaylistByName(string $userId, string $playlistName, array $options = []): PlaylistDataProvider; |
|
49 | + public function getUserPlaylistByName(string $userId, string $playlistName, array $options = [ ]): PlaylistDataProvider; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @param TrackSearchRequestDataProvider $trackSearchRequest |
53 | 53 | * @param array $options |
54 | 54 | * @return TracksSearchDataProvider |
55 | 55 | */ |
56 | - public function searchTrack(TrackSearchRequestDataProvider $trackSearchRequest, array $options = []): TracksSearchDataProvider; |
|
56 | + public function searchTrack(TrackSearchRequestDataProvider $trackSearchRequest, array $options = [ ]): TracksSearchDataProvider; |
|
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function getClientId(): string |
14 | 14 | { |
15 | - $clientId = (string)getenv('CLIENT_ID'); |
|
15 | + $clientId = (string) getenv('CLIENT_ID'); |
|
16 | 16 | if (empty($clientId)) { |
17 | 17 | throw new RuntimeException( |
18 | 18 | sprintf(Message::ERROR_GET_ENV_VARIABLE, CLIENT_ID) |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function getClientSecret(): string |
29 | 29 | { |
30 | - $clientSecret = (string)getenv('CLIENT_SECRET'); |
|
30 | + $clientSecret = (string) getenv('CLIENT_SECRET'); |
|
31 | 31 | if (empty($clientSecret)) { |
32 | 32 | throw new RuntimeException( |
33 | 33 | sprintf(Message::ERROR_GET_ENV_VARIABLE, CLIENT_SECRET) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function getRedirectUri(): string |
44 | 44 | { |
45 | - $redirectUri = (string)getenv('REDIRECT_URI'); |
|
45 | + $redirectUri = (string) getenv('REDIRECT_URI'); |
|
46 | 46 | if (empty($redirectUri)) { |
47 | 47 | throw new RuntimeException( |
48 | 48 | sprintf(Message::ERROR_GET_ENV_VARIABLE, REDIRECT_URI) |