team-reflex / valorant-php
Riot 的 VALORANT API 的 PSR-18 兼容包。
0.9
2020-11-06 12:58 UTC
Requires
- php: ^7.4
- ext-json: *
- illuminate/collections: ~8.0
- myclabs/php-enum: ^1.7
- psr/http-client: ^1.0
- spatie/data-transfer-object: ^2.5
Requires (Dev)
- guzzlehttp/guzzle: ^7.2
- phpunit/phpunit: ^9.4
This package is auto-updated.
Last update: 2024-09-06 23:25:50 UTC
README
Riot 的 VALORANT API 的 PSR-18 兼容包。
注意
由于我还没有访问到 VALORANT API,比赛端点已被盲写。
我能够使用的唯一资源是从 Riot Dev Discord 服务器上的 一些样本 JSON,来自 Riot Tuxedo。
基于这个 JSON,生成了 Match 资源中的每个 DTO,因此可能不准确,也没有正确设置每个类型。
安装
需要 PHP 7.4,因为它利用了其类型支持。
通过 composer 安装
composer require team-reflex/valorant-php
使用方法
由于包符合 PSR-18 标准,因此默认不包含 HTTP 客户端。
您可以使用 Guzzle 等客户端,并在实例化时传递其实例
$http = new GuzzleHttp\Client(); $valorant = new Valorant($http, 'api_key_here', AccountRegion::AMERICAS(), MatchRegion::AMERICA());
现在您已经准备好进行请求了
$player = $valorant->fetchAccountByRiot('Kairu#1481');