brieucthomas/ergast-client
最新稳定版本:v1.0.1
Composer 安装命令:
composer require brieucthomas/ergast-client
包简介
PHP client for Ergast Developer API
README 文档
README
PHP client for Ergast Developer API.
Requirements
PHP needs to be a minimum version of PHP 7.
Installation
This library can be easily installed via Composer:
composer require brieucthomas/ergast-client
or just add it to your composer.json file directly and run composer install.
Usage
use BrieucThomas\ErgastClient\ErgastClientBuilder; use BrieucThomas\ErgastClient\Request\RequestBuilder; $ergastClient = ErgastClientBuilder::createErgastClient(); $requestBuilder = new RequestBuilder(); $requestBuilder ->findCircuits() ->byId('monza') ; $response = $ergastClient->execute($requestBuilder->build()); $circuit = $response->getCircuits()->first(); echo $circuit->getId(); // "monza" echo $circuit->getName(); // "Autodromo Nazionale di Monza" echo $circuit->getUrl(); // "http://en.wikipedia.org/wiki/Autodromo_Nazionale_Monza" echo $circuit->getLocation()->getLocality(); // "Monza" echo $circuit->getLocation()->getCountry(); // "Italy" echo $circuit->getLocation()->getLatitude(); // 45.6156 echo $circuit->getLocation()->getLongitude(); // 9.28111
Limit and offset
$uriBuilder ->setFirstResult(2) ->setMaxResults(5) ;
统计信息
- 总下载量: 831
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-14