zeggriim / riot-api-datadragon
Riot DataDragon API包装器
2.0.6
2024-06-23 16:20 UTC
Requires
- php: ^8.2
- symfony/console: ^6.4
- symfony/framework-bundle: ^6.4
- symfony/http-client: 6.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.52
- phpunit/phpunit: ^10.4
- symfony/var-dumper: ^6.4
- dev-main
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.7
- 1.0.6.x-dev
- 1.0.6
- 1.0.5.x-dev
- 1.0.5
- 1.0.4.x-dev
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- v0.0.4.x-dev
- v0.0.3
- v0.0.2
- v0.0.1
- dev-develop
- dev-fix/enum-queue
- dev-feat/riot-api-league
- dev-fix/dataDragon-Champion-API
- dev-feat/EndpointLeagueApi
- dev-fix/config
- dev-fix/add-config-http
- dev-11-ajouter-platform-routing
This package is auto-updated.
Last update: 2024-09-23 17:02:14 UTC
README
介绍
欢迎来到PHP DataDragon库的仓库!这个库的目的是为所有需要的人创建一个易于使用的库。
此Symfony 6捆绑包提供了与Riot Games API(特别是《英雄联盟》的数据Dragon数据)的简单而有效的集成。 (其他API即将到来)它允许您轻松访问有关英雄、物品、技能等信息,直接从您的Symfony应用程序中获取。
安装
要安装此捆绑包,请使用Composer
composer require zeggriim/riot-api-data-dragon-bundle
添加捆绑包
// config/bundles.php return [ // Other Bundles Zeggriim\RiotApiDataDragon\RiotApiDataDragonBundle::class => ['all' => true], ];
配置
在所需环境的.env
文件中添加
API_RIO_BASE_URI='https://ddragon.leagueoflegends.com'
示例
namespace App\Controller; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Zeggriim\RiotApiDataDragon\Endpoint\DataDragon\VersionApiInterface; class HomeController { #[Route('/home', name: 'app_home')] public function index(VersionApiInterface $versionApi): Response { $versionApi->getVersions(); // ['14.8.1','14.7.1','14.6.1','14.5.1','14.4.1'....] } }