SpotifyWebAPI\Request::setReturnAssoc PHP Method

setReturnAssoc() public method

Set the return type for the response body.
public setReturnAssoc ( boolean $returnAssoc ) : void
$returnAssoc boolean Whether to return an associative array or an stdClass.
return void
    public function setReturnAssoc($returnAssoc)
    {
        $this->returnAssoc = $returnAssoc;
    }

Usage Example

Ejemplo n.º 1
0
 public function testSendReturnAssoc()
 {
     $request = new SpotifyWebAPI\Request();
     $request->setReturnAssoc(true);
     $response = $request->send('GET', 'https://api.spotify.com/v1/albums/7u6zL7kqpgLPISZYXNTgYk');
     $this->assertArrayHasKey('id', $response['body']);
 }