SpotifyWebAPI\Request::setReturnAssoc PHP Метод

setReturnAssoc() публичный Метод

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

Usage Example

Пример #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']);
 }