tnapf / spotify
Spotify API 包装器
v0.1.0-alpha
2023-05-24 17:41 UTC
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.7
- httpsoft/http-server-request: ^1.1.0
- psr/http-client: ^1.0
- tnapf/jsonmapper: ^v1.0.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.31
- fakerphp/faker: ^1.21
- friendsofphp/php-cs-fixer: ^3.16
- jetbrains/phpstorm-attributes: ^1.0
- phpunit/phpunit: ^10.1
- roave/security-advisories: dev-latest
- tnapf/env: ^1.0
- xheaven/composer-git-hooks: ^3.0
This package is auto-updated.
Last update: 2024-09-24 12:13:34 UTC
README
PHP 的 Spotify API 客户端(仍在开发中)
安装
composer require tnapf/spotify
使用
创建新的 Spotify 对象
use Tnapf\Spotify\Client; use Psr\Http\Client\ClientInterface; $httpClient = ClientInterface::class; // <- must be a client interface implementation $spotify = new Client($httpClient, $clientId, $clientSecret);
发送请求
/** @var Album */ $spotify->albums->get('0rGKEhiSyEwmcpQoU5Gg61');
由于所有内容最终都将进行映射,因此您的 IDE 将提供自动完成功能,您不必总是查阅文档。