mouyong / foundation-sdk
Package description here.
Installs: 1 932
Dependents: 4
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- adbario/php-dot-notation: ^2.0
- guzzlehttp/guzzle: ^6.0 | ^7.0
- monolog/monolog: ^2.0 | ^1.0
- pimple/pimple: ^3.0
- symfony/cache: ^5.0 | ^4.0
- symfony/http-foundation: ^5.0 | ^4.0
README
.
Installing
$ composer require mouyong/foundation-sdk -vvv
Usage
创建 Application 继承 Foundation,在 Application 类中,继承 $config、$provider 属性。
创建 Client 继承 AbstractClient。实现父类中的 sign 签名函数(如无签名直接返回数据)、request 函数发起 http 请求、castResponseToType 处理响应信息,并在 request 中调用 castResponseToType 函数。
在 castResponseToType 中,可以进行错误校验,数据提取等操作。
如果 api 需要 access_token 等信息。创建 AccessToken 继承 AbstractAccessToken 类。实现父类的相关函数。根据需要覆盖父类的相关属性。
创建相应的函数,并绑定到容器中。
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
LGPL