hyperplural/warface-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hyperplural/warface-sdk

最新稳定版本:5.2.0

Composer 安装命令:

composer require hyperplural/warface-sdk

包简介

Fast and flexible SDK client of the Warface API in PHP.

README 文档

README

Coverage

Fast, PSR‑18 HTTP‑client agnostic SDK for the public Warface API. Requires PHP >= 8.1.

Installation

composer require hyperplural/warface-sdk guzzlehttp/guzzle:^7 http-interop/http-factory-guzzle:^1

Decoupled from any specific HTTP client via HTTPlug.

Quickstart

use Hyperplural\WarfaceSdk\Client;
use Hyperplural\WarfaceSdk\Enum\RatingLeague;
use Hyperplural\WarfaceSdk\Enum\GameClass;

$client = new Client();

// Player stats
$stat = $client->user()->stat('Nickname');

// Player achievements
$achievements = $client->user()->achievements('Nickname');

// Achievement catalog
$catalog = $client->achievement()->catalog();

// Clan info
$clan = $client->clan()->members('ClanName');

// Missions
$missions = $client->game()->missions();

// Ratings
$monthly = $client->rating()->monthly('', RatingLeague::ELITE);
$top100 = $client->rating()->top100(GameClass::MEDIC);

Custom HTTP client

Provide your own PSR‑18 client (e.g., Symfony HttpClient with HTTPlug adapter):

use Hyperplural\WarfaceSdk\Client;
use Symfony\Component\HttpClient\HttplugClient;

$client = Client::createWithHttpClient(new HttplugClient());

References

Testing

composer test

Unit tests rely on JSON fixtures and a mock HTTP client — no network required. CI enforces 100% line coverage.

License

MIT. See LICENSE for details.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-08