rmasters/swapi
最新稳定版本:v0.2.0
Composer 安装命令:
composer require rmasters/swapi
包简介
README 文档
README
## Usage
Install with Composer: composer require "rmasters/swapi:~1.0".
require_once __DIR__ . '/vendor/autoload.php'; use SWAPI\SWAPI; $swapi = new SWAPI; $swapi->characters()->index(); => Character[] $swapi->characters()->index(2); => Character[] $swapi->vehicles()->get(1); => Vehicle <X-wing> $swapi->planets()->get(7); => Planet <Mustafar> $swapi->people()->get(9999); => null (not-found) // Iteration do { if (!isset($starships)) { $starships = $swapi->starships()->index(); } else { $starships = $starships->getNext(); } foreach ($starships as $s) { echo "{$s->name}\n"; } } while ($starships->hasNext());
## Running tests and contributing
Install dependencies with composer install --dev and run vendor/bin/phpunit
to run the testsuite. The test suite comprises of:
- tests/Endpoints - tests that use mocked sample responses,
- tests/Functional - tests that use the live API, to spot changes.
License
统计信息
- 总下载量: 272
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-22