Skip to content

Commit

Permalink
Correct inline docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilsson committed Apr 14, 2017
1 parent 6d3edaf commit d725d16
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 47 deletions.
2 changes: 1 addition & 1 deletion docs/examples/controlling-user-playback.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Sometimes, a API call might return a `202 Accepted` response code. When this occ
$lastResponse = $api->getLastResponse();

if ($lastResponse['status'] == 202) {
// Perform some logic to retry the request after s few seconds
// Perform some logic to retry the request after a few seconds
}
}
} catch (Exception $e) {
Expand Down
57 changes: 28 additions & 29 deletions docs/method-reference/SpotifyWebAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,16 @@ Add tracks to a user's playlist.<br>
### changeMyDevice


boolean SpotifyWebAPI\SpotifyWebAPI::changeMyDevice($options)
boolean SpotifyWebAPI\SpotifyWebAPI::changeMyDevice(array|object $options)

Change the current user's playback device.<br>
[https://developer.spotify.com/web-api/transfer-a-users-playback/](https://developer.spotify.com/web-api/transfer-a-users-playback/)<br>
<br>
* @param array|object $options Options for the playback transfer.<br>
- device_ids string|array Required. ID of the device to switch to.<br>
- play boolean. Optional. Whether to start playing on the new device
[https://developer.spotify.com/web-api/transfer-a-users-playback/](https://developer.spotify.com/web-api/transfer-a-users-playback/)

#### Arguments
* `$options` **mixed**
* `$options` **array\|object** - Options for the playback transfer.
* string\|array device_ids Required. ID of the device to switch to.
* bool play Optional. Whether to start playing on the new device



#### Return values
Expand All @@ -109,20 +108,20 @@ Change the current user's playback device.<br>
### changeVolume


array SpotifyWebAPI\SpotifyWebAPI::changeVolume(array|object $options)
boolean SpotifyWebAPI\SpotifyWebAPI::changeVolume(array|object $options)

Change playback volume for the current user.<br>
[https://developer.spotify.com/web-api/set-volume-for-users-playback/](https://developer.spotify.com/web-api/set-volume-for-users-playback/)

#### Arguments
* `$options` **array\|object** - Optional. Options for the playback volume.
* string volume_percent Required. The volume to set.
* int volume_percent Required. The volume to set.
* string device_id Optional. ID of the device to target.



#### Return values
* **array** Whether the playback volume was successfully changed.
* **boolean** Whether the playback volume was successfully changed.


---
Expand All @@ -139,8 +138,8 @@ Create a new playlist for a user.<br>
#### Arguments
* `$userId` **string** - ID of the user to create the playlist for.
* `$options` **array\|object** - Options for the new playlist.
* name string Required. Name of the playlist.
* public bool Optional. Whether the playlist should be public or not.
* string name Required. Name of the playlist.
* bool public Optional. Whether the playlist should be public or not.



Expand Down Expand Up @@ -221,8 +220,8 @@ Delete tracks from a playlist and retrieve a new snapshot ID.<br>
* `$userId` **string** - ID of the user who owns the playlist.
* `$playlistId` **string** - ID of the playlist to delete tracks from.
* `$tracks` **array** - Array of arrays or objects with tracks to delete.
* id string Required. Spotify track ID.
* positions int\|array Optional. The track&#039;s position(s) in the playlist.
* string id Required. Spotify track ID.
* int\|array positions Optional. The track&#039;s position(s) in the playlist.

* `$snapshotId` **string** - Optional. The playlist&#039;s snapshot ID.

Expand Down Expand Up @@ -266,7 +265,7 @@ Add the current user as a follower of a playlist.<br>
* `$userId` **string** - ID of the user who owns the playlist.
* `$playlistId` **string** - ID of the playlist to follow.
* `$options` **array\|object** - Optional. Options for the followed playlist.
* public bool Optional. Whether the playlist should be followed publicly or not.
* bool public Optional. Whether the playlist should be followed publicly or not.



Expand Down Expand Up @@ -1096,7 +1095,7 @@ Check if tracks are saved in the current user's Spotify library.<br>
### next


array SpotifyWebAPI\SpotifyWebAPI::next(string $deviceId)
boolean SpotifyWebAPI\SpotifyWebAPI::next(string $deviceId)

Play the next track in the current users's queue.<br>
[https://developer.spotify.com/web-api/skip-users-playback-to-next-track/](https://developer.spotify.com/web-api/skip-users-playback-to-next-track/)
Expand All @@ -1106,7 +1105,7 @@ Play the next track in the current users's queue.<br>


#### Return values
* **array** Whether the track was successfully skipped.
* **boolean** Whether the track was successfully skipped.


---
Expand All @@ -1115,7 +1114,7 @@ Play the next track in the current users's queue.<br>
### pause


array SpotifyWebAPI\SpotifyWebAPI::pause(string $deviceId)
boolean SpotifyWebAPI\SpotifyWebAPI::pause(string $deviceId)

Pause playback for the current user.<br>
[https://developer.spotify.com/web-api/pause-a-users-playback/](https://developer.spotify.com/web-api/pause-a-users-playback/)
Expand All @@ -1125,7 +1124,7 @@ Pause playback for the current user.<br>


#### Return values
* **array** Whether the playback was successfully paused.
* **boolean** Whether the playback was successfully paused.


---
Expand All @@ -1134,7 +1133,7 @@ Pause playback for the current user.<br>
### play


array SpotifyWebAPI\SpotifyWebAPI::play(string $deviceId, array|object $options)
boolean SpotifyWebAPI\SpotifyWebAPI::play(string $deviceId, array|object $options)

Start playback for the current user.<br>
[https://developer.spotify.com/web-api/start-a-users-playback/](https://developer.spotify.com/web-api/start-a-users-playback/)
Expand All @@ -1149,7 +1148,7 @@ Start playback for the current user.<br>


#### Return values
* **array** Whether the playback was successfully started.
* **boolean** Whether the playback was successfully started.


---
Expand All @@ -1158,7 +1157,7 @@ Start playback for the current user.<br>
### previous


array SpotifyWebAPI\SpotifyWebAPI::previous(string $deviceId)
boolean SpotifyWebAPI\SpotifyWebAPI::previous(string $deviceId)

Play the previous track in the current users's queue.<br>
[https://developer.spotify.com/web-api/skip-users-playback-to-previous-track/](https://developer.spotify.com/web-api/skip-users-playback-to-previous-track/)
Expand All @@ -1168,7 +1167,7 @@ Play the previous track in the current users's queue.<br>


#### Return values
* **array** Whether the track was successfully skipped.
* **boolean** Whether the track was successfully skipped.


---
Expand Down Expand Up @@ -1203,7 +1202,7 @@ Reorder the tracks in a user's playlist.<br>
### repeat


array SpotifyWebAPI\SpotifyWebAPI::repeat(array|object $options)
boolean SpotifyWebAPI\SpotifyWebAPI::repeat(array|object $options)

Set repeat mode for the current user’s playback.<br>
[https://developer.spotify.com/web-api/set-repeat-mode-on-users-playback/](https://developer.spotify.com/web-api/set-repeat-mode-on-users-playback/)
Expand All @@ -1216,7 +1215,7 @@ Set repeat mode for the current user’s playback.<br>


#### Return values
* **array** Whether the playback repeat mode was successfully changed.
* **boolean** Whether the playback repeat mode was successfully changed.


---
Expand Down Expand Up @@ -1272,7 +1271,7 @@ Requires a valid access token if market=from_token is used.<br>
### seek


array SpotifyWebAPI\SpotifyWebAPI::seek(array|object $options)
boolean SpotifyWebAPI\SpotifyWebAPI::seek(array|object $options)

Change playback position for the current user.<br>
[https://developer.spotify.com/web-api/seek-to-position-in-currently-playing-track/](https://developer.spotify.com/web-api/seek-to-position-in-currently-playing-track/)
Expand All @@ -1285,7 +1284,7 @@ Change playback position for the current user.<br>


#### Return values
* **array** Whether the playback position was successfully changed.
* **boolean** Whether the playback position was successfully changed.


---
Expand Down Expand Up @@ -1349,7 +1348,7 @@ Set the return type for the response body.
### shuffle


array SpotifyWebAPI\SpotifyWebAPI::shuffle(array|object $options)
boolean SpotifyWebAPI\SpotifyWebAPI::shuffle(array|object $options)

Set shuffle mode for the current user’s playback.<br>
[https://developer.spotify.com/web-api/toggle-shuffle-for-users-playback/](https://developer.spotify.com/web-api/toggle-shuffle-for-users-playback/)
Expand All @@ -1362,7 +1361,7 @@ Set shuffle mode for the current user’s playback.<br>


#### Return values
* **array** Whether the playback shuffle mode was successfully changed.
* **boolean** Whether the playback shuffle mode was successfully changed.


---
Expand Down
34 changes: 17 additions & 17 deletions src/SpotifyWebAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ public function addUserPlaylistTracks($userId, $playlistId, $tracks, $options =
* Change the current user's playback device.
* https://developer.spotify.com/web-api/transfer-a-users-playback/
*
* * @param array|object $options Options for the playback transfer.
* - device_ids string|array Required. ID of the device to switch to.
* - play boolean. Optional. Whether to start playing on the new device
* @param array|object $options Options for the playback transfer.
* - string|array device_ids Required. ID of the device to switch to.
* - bool play Optional. Whether to start playing on the new device
*
* @return bool Whether the playback device was successfully changed.
*/
Expand All @@ -186,10 +186,10 @@ public function changeMyDevice($options)
* https://developer.spotify.com/web-api/set-volume-for-users-playback/
*
* @param array|object $options Optional. Options for the playback volume.
* - string volume_percent Required. The volume to set.
* - int volume_percent Required. The volume to set.
* - string device_id Optional. ID of the device to target.
*
* @return array Whether the playback volume was successfully changed.
* @return bool Whether the playback volume was successfully changed.
*/
public function changeVolume($options)
{
Expand All @@ -211,8 +211,8 @@ public function changeVolume($options)
*
* @param string $userId ID of the user to create the playlist for.
* @param array|object $options Options for the new playlist.
* - name string Required. Name of the playlist.
* - public bool Optional. Whether the playlist should be public or not.
* - string name Required. Name of the playlist.
* - bool public Optional. Whether the playlist should be public or not.
*
* @return array|object The new playlist. Type is controlled by `SpotifyWebAPI::setReturnType()`.
*/
Expand Down Expand Up @@ -309,8 +309,8 @@ public function deleteMyTracks($tracks)
* @param string $userId ID of the user who owns the playlist.
* @param string $playlistId ID of the playlist to delete tracks from.
* @param array $tracks Array of arrays or objects with tracks to delete.
* - id string Required. Spotify track ID.
* - positions int|array Optional. The track's position(s) in the playlist.
* - string id Required. Spotify track ID.
* - int|array positions Optional. The track's position(s) in the playlist.
* @param string $snapshotId Optional. The playlist's snapshot ID.
*
* @return string|bool A new snapshot ID or false if the tracks weren't successfully deleted.
Expand Down Expand Up @@ -387,7 +387,7 @@ public function followArtistsOrUsers($type, $ids)
* @param string $userId ID of the user who owns the playlist.
* @param string $playlistId ID of the playlist to follow.
* @param array|object $options Optional. Options for the followed playlist.
* - public bool Optional. Whether the playlist should be followed publicly or not.
* - bool public Optional. Whether the playlist should be followed publicly or not.
*
* @return bool Whether the playlist was successfully followed.
*/
Expand Down Expand Up @@ -1262,7 +1262,7 @@ public function myTracksContains($tracks)
*
* @param string $deviceId Optional. ID of the device to target.
*
* @return array Whether the track was successfully skipped.
* @return bool Whether the track was successfully skipped.
*/
public function next($deviceId = '')
{
Expand All @@ -1286,7 +1286,7 @@ public function next($deviceId = '')
*
* @param string $deviceId Optional. ID of the device to pause on.
*
* @return array Whether the playback was successfully paused.
* @return bool Whether the playback was successfully paused.
*/
public function pause($deviceId = '')
{
Expand Down Expand Up @@ -1314,7 +1314,7 @@ public function pause($deviceId = '')
* - array uris Optional. Spotify track URIs to play.
* - object offset Optional. Indicates from where in the context playback should start.
*
* @return array Whether the playback was successfully started.
* @return bool Whether the playback was successfully started.
*/
public function play($deviceId = '', $options = [])
{
Expand All @@ -1341,7 +1341,7 @@ public function play($deviceId = '', $options = [])
*
* @param string $deviceId Optional. ID of the device to target.
*
* @return array Whether the track was successfully skipped.
* @return bool Whether the track was successfully skipped.
*/
public function previous($deviceId = '')
{
Expand Down Expand Up @@ -1400,7 +1400,7 @@ public function reorderUserPlaylistTracks($userId, $playlistId, $options)
* - string state Required. The repeat mode. See Spotify docs for possible values.
* - string device_id Optional. ID of the device to target.
*
* @return array Whether the playback repeat mode was successfully changed.
* @return bool Whether the playback repeat mode was successfully changed.
*/
public function repeat($options)
{
Expand Down Expand Up @@ -1482,7 +1482,7 @@ public function search($query, $type, $options = [])
* - string position_ms Required. The position in milliseconds to seek to.
* - string device_id Optional. ID of the device to target.
*
* @return array Whether the playback position was successfully changed.
* @return bool Whether the playback position was successfully changed.
*/
public function seek($options)
{
Expand Down Expand Up @@ -1551,7 +1551,7 @@ public function setReturnType($returnType)
* - bool state Required. The shuffle mode. See Spotify docs for possible values.
* - string device_id Optional. ID of the device to target.
*
* @return array Whether the playback shuffle mode was successfully changed.
* @return bool Whether the playback shuffle mode was successfully changed.
*/
public function shuffle($options)
{
Expand Down

0 comments on commit d725d16

Please sign in to comment.