[PR #15] [MERGED] Added option to set return type to assoc array #223

Closed
opened 2026-02-27 19:26:42 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jwilsson/spotify-web-api-php/pull/15
Author: @baskillen
Created: 10/29/2014
Status: Merged
Merged: 10/30/2014
Merged by: @jwilsson

Base: masterHead: master


📝 Commits (1)

  • b95bf3f Added option to set return type to assoc array

📊 Changes

4 files changed (+108 additions, -2 deletions)

View changed files

📝 src/Request.php (+41 -2)
📝 src/SpotifyWebAPI.php (+26 -0)
📝 tests/RequestTest.php (+21 -0)
📝 tests/SpotifyWebAPITest.php (+20 -0)

📄 Description

In order to make it possible to retrieve an associative array as the response from the web API we needed to add this functionality. I'm not sure if there is a better way to do this, but this seems to work fine for us.

The option to retrieve an array is much cleaner than writing a recursive wrapper that tranforms the stdObject to an array.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jwilsson/spotify-web-api-php/pull/15 **Author:** [@baskillen](https://github.com/baskillen) **Created:** 10/29/2014 **Status:** ✅ Merged **Merged:** 10/30/2014 **Merged by:** [@jwilsson](https://github.com/jwilsson) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`b95bf3f`](https://github.com/jwilsson/spotify-web-api-php/commit/b95bf3f3e4f702486e1de36633b131531b4a0546) Added option to set return type to assoc array ### 📊 Changes **4 files changed** (+108 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/Request.php` (+41 -2) 📝 `src/SpotifyWebAPI.php` (+26 -0) 📝 `tests/RequestTest.php` (+21 -0) 📝 `tests/SpotifyWebAPITest.php` (+20 -0) </details> ### 📄 Description In order to make it possible to retrieve an associative array as the response from the web API we needed to add this functionality. I'm not sure if there is a better way to do this, but this seems to work fine for us. The option to retrieve an array is much cleaner than writing a recursive wrapper that tranforms the stdObject to an array. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 19:26:42 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#223
No description provided.