atapatel/sylius-api-client
最新稳定版本:0.2.6
Composer 安装命令:
composer require atapatel/sylius-api-client
包简介
A client for Sylius APIs
README 文档
README
Install
Via Composer
$ composer require friendsofapi/sylius-api-client
Usage
$apiClient = SyliusClient::create($endpoint, $clientId, $clientSecret); $accessToken = $apiClient->createNewAccessToken($username, $password); $apiClient->authenticate($accessToken); $allProducts = $apiClient->product()->getAll()
Develop
APIs are usually split into categories, called Resources.
In your implementation you should also reflect these categories, for example by having their own classes in Api/.
Let's take a look at Api/Stats in our case. The response of any call should be an object in Model/Stats/X,
like Model/Stats/Total.
Hydrator
The end user chooses which hydrator to use. The default one should return domain objects.
Request builder
The request builder creates a PSR-7 request with a multipart stream when necessary
If the API does not require multipart streams you should remove the RequestBuilder
and replace it with a RequestFactory.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 728
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-19