focus-sports-labs / fsl-data-center
Focus Sports Labs 数据中心 API 的 PHP SDK
v0.0.1
2023-12-30 20:51 UTC
Requires
- php: ^8.1
- ext-json: *
- php-http/client-common: ^2.7
- php-http/discovery: ^1.19
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- symfony/options-resolver: ^6.4
- thecodingmachine/safe: ^2.5
Requires (Dev)
- laravel/pint: ^1.13
- nyholm/psr7: ^1.8
- pestphp/pest: ^2.29
- php-http/mock-client: ^1.6
- phpstan/phpstan: ^1.10
- symfony/http-client: ^6.4
- symfony/var-dumper: ^6.4
- thecodingmachine/phpstan-safe-rule: ^1.2
- dev-main
- v0.0.1
- v0.0.0
- dev-dependabot/composer/phpstan/phpstan-1.12.4
- dev-dependabot/composer/phpstan/phpstan-1.11.1
- dev-dependabot/composer/phpstan/phpstan-1.11.0
- dev-dependabot/composer/symfony/var-dumper-6.4.7
- dev-dependabot/composer/symfony/options-resolver-6.4.7
- dev-dependabot/github_actions/dependabot/fetch-metadata-2.1.0
- dev-dependabot/composer/laravel/pint-1.15.2
This package is auto-updated.
Last update: 2024-09-23 07:16:06 UTC
README
这是一个用于FSL 数据中心 API的简单 PHP SDK。
使用此 SDK,您可以轻松地与 FSL 数据中心 API 进行通信
以下是提供的一些方法示例
use FocusSportsLabs\FslDataCenter\Client; use FocusSportsLabs\FslDataCenter\HttpClient\Options; // This file is generated by Composer require_once __DIR__ . '/vendor/autoload.php'; $options = new Options([ 'auth_token' => 'token', // get this from your application profile 'origin' => 'https://', // you set this when creating your application ]); $client = new Client($options); $response = $client->countries()->list(); // this would give you a list of all countries supported by FSL dump($response);
要求
要使用此项目,您需要
安装
您可以通过运行以下命令使用 composer 安装该软件包
composer require focus-sports-labs/data-center-php-sdk
如何获取 API 密钥
首先,您需要在FSL 数据中心 API创建或登录您的账户
接下来,创建一个应用程序以获取 API 密钥和源
请务必复制您的 API 密钥,因为您在设置客户端时需要它。
用法
首先实例化客户端
use FocusSportsLabs\FslDataCenter\Client; use FocusSportsLabs\FslDataCenter\HttpClient\Options; // This file is generated by Composer require_once __DIR__ . '/vendor/autoload.php'; $options = new Options([ 'auth_token' => 'token', // get this from your application profile 'origin' => 'https://', // you set this when creating your application ]); $client = new Client($options);
现在您有了客户端,您可以访问所有可用的端点。如下所示
<?php // use the request helper to access endpoints $countries = $client->request('countries')->list(); // or use the magic method to access endpoints $countries = $client->countries()->list();
更多信息即将到来
测试
使用以下命令运行测试
vendor/bin/pest
路线图
以下是待完成的任务列表
- 为每个请求添加文档
- 为每个请求添加测试
变更日志
有关最近更改的更多信息,请参阅变更日志。
贡献
有关详细信息,请参阅贡献指南。
安全
如果您发现有关安全性的错误,请通过abdulkudus2922@gmail.com发送电子邮件,而不是使用问题跟踪器。
鸣谢
许可
MIT 许可证 (MIT)。有关更多信息,请参阅许可文件。