buonzz /epoch-csa-client
Epoch客户搜索API交互的PHP客户端库。
v1.0.01
2019-08-03 11:51 UTC
Requires
- php: >=5.4
- ext-simplexml: *
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2024-09-19 01:10:56 UTC
README
此库允许您通过将API调用封装到简单的对象中来轻松与Epoch的搜索API交互,这些对象验证并确保参数值的完整性和正确的数据类型。大多数类将抛出InvalidArgumentException,防止您的应用程序执行带有可能无效值的API调用,从而提高应用程序的质量。
功能
- 验证每个参数以确保您使用正确的值
- 将必需/可选参数映射到每个操作(搜索、过期等)
安装
使用composer安装
composer require buonzz/epoch-csa-client
使用方法
以下示例通过会员ID搜索会员
use Buonzz\Epoch\CustomerSearch\Client;
use Buonzz\Epoch\CustomerSearch\Actions\Search;
use Buonzz\Epoch\CustomerSearch\Parameters\Memberid;
// create a new parameter object
$memberid = new Memberid(1234587);
// create a new action
$search = new Search();
// create a client to connect to the API
$client = new Client('mahuser', 'mahpass');
// pass the action and array of parameters to execute method of the client object
$output = $client->execute($search, [$memberid]);
// now the result can be used for whatever purpose it may serve
var_dump($output);
贡献
您可以通过编辑docs文件夹中的文件来在文档方面做出贡献。重新生成文档
make html