Skip to content

Commit f165b6b

Browse files
committed
Remove deprecated SpotifyWebAPI::usersFollowPlaylist() method
1 parent fe4b5e6 commit f165b6b

File tree

3 files changed

+0
-91
lines changed

3 files changed

+0
-91
lines changed

docs/method-reference/SpotifyWebAPI.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
* [unfollowPlaylist](#unfollowplaylist)
9292
* [updatePlaylist](#updateplaylist)
9393
* [updatePlaylistImage](#updateplaylistimage)
94-
* [usersFollowPlaylist](#usersfollowplaylist)
9594

9695
## Constants
9796

@@ -1776,23 +1775,3 @@ https://developer.spotify.com/documentation/web-api/reference/upload-custom-play
17761775
* **bool** Whether the playlist was successfully updated.
17771776

17781777
---
1779-
### usersFollowPlaylist
1780-
1781-
_Deprecated. Use SpotifyWebAPI::currentUserFollowsPlaylist() instead._
1782-
1783-
```php
1784-
SpotifyWebAPI::usersFollowPlaylist($playlistId, $options)
1785-
```
1786-
1787-
Check if a set of users are following a playlist.<br>
1788-
https://developer.spotify.com/documentation/web-api/reference/check-if-user-follows-playlist
1789-
1790-
#### Arguments
1791-
* `$playlistId` **string** - ID or URI of the playlist.
1792-
* `$options` **array\|object** - Optional. Options for the check.
1793-
* ids string\|array ID or URI of the current user.
1794-
1795-
#### Return values
1796-
* **array** Whether the current user is following the playlist.
1797-
1798-
---

src/SpotifyWebAPI.php

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,45 +2265,4 @@ public function updatePlaylistImage(string $playlistId, string $imageData): bool
22652265

22662266
return $this->lastResponse['status'] == 202;
22672267
}
2268-
2269-
/**
2270-
* Check if a set of users are following a playlist.
2271-
* https://developer.spotify.com/documentation/web-api/reference/check-if-user-follows-playlist
2272-
*
2273-
* @deprecated Use SpotifyWebAPI::currentUserFollowsPlaylist() instead.
2274-
*
2275-
* @param string $playlistId ID or URI of the playlist.
2276-
* @param array|object $options Optional. Options for the check.
2277-
* - ids string|array ID or URI of the current user.
2278-
*
2279-
* @return array Whether the current user is following the playlist.
2280-
*/
2281-
public function usersFollowPlaylist(string $playlistId, array|object $options = []): array
2282-
{
2283-
trigger_error(
2284-
// phpcs:ignore
2285-
'SpotifyWebAPI::usersFollowPlaylist() is deprecated. Use SpotifyWebAPI::currentUserFollowsPlaylist() instead.',
2286-
E_USER_DEPRECATED
2287-
);
2288-
2289-
$options = (array) $options;
2290-
2291-
if (isset($options['ids'])) {
2292-
trigger_error(
2293-
'Passing IDs to usersFollowPlaylist is deprecated. The current user will always be used.',
2294-
E_USER_DEPRECATED
2295-
);
2296-
2297-
$options['ids'] = $this->uriToId($options['ids'], 'user');
2298-
$options['ids'] = $this->toCommaString($options['ids']);
2299-
}
2300-
2301-
$playlistId = $this->uriToId($playlistId, 'playlist');
2302-
2303-
$uri = '/v1/playlists/' . $playlistId . '/followers/contains';
2304-
2305-
$this->lastResponse = $this->sendRequest('GET', $uri, $options);
2306-
2307-
return $this->lastResponse['body'];
2308-
}
23092268
}

tests/SpotifyWebAPITest.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,35 +2411,6 @@ public function testUpdatePlaylistImage()
24112411
);
24122412
}
24132413

2414-
public function testUsersFollowPlaylist()
2415-
{
2416-
$options = [
2417-
'ids' => [
2418-
'spotify:user:mcgurk',
2419-
],
2420-
];
2421-
2422-
$expected = [
2423-
'ids' => 'mcgurk',
2424-
];
2425-
2426-
$return = ['body' => get_fixture('users-follows-playlist')];
2427-
$api = $this->setupApi(
2428-
'GET',
2429-
'/v1/playlists/0UZ0Ll4HJHR7yvURYbHJe9/followers/contains',
2430-
$expected,
2431-
[],
2432-
$return
2433-
);
2434-
2435-
$response = $api->usersFollowPlaylist(
2436-
'spotify:playlist:0UZ0Ll4HJHR7yvURYbHJe9',
2437-
$options
2438-
);
2439-
2440-
$this->assertTrue($response[0]);
2441-
}
2442-
24432414
public function testSetAccessToken() {
24442415
$api = new SpotifyWebAPI();
24452416
$returnedValue = $api->setAccessToken($this->accessToken);

0 commit comments

Comments
 (0)