mwojtowicz/gusclient

GUS公司数据库API客户端

2.2 2017-11-07 21:54 UTC

This package is not auto-updated.

Last update: 2024-09-13 13:10:23 UTC


README

Latest Stable Version Travis build on master Coverage Status Total Downloads License

1. 安装

composer require mwojtowicz/gusclient

2. 使用方法

每个客户端都是GusClientInterface的一个实例,它有一个方法find。查找方法接受字符串或字符串数组作为输入。

在使用此库之前,您必须注册您的用户密钥。注册后,您可以将它作为构造函数参数。

您可以将此密钥作为环境变量GUSAPI_KEY传递。如果不将其作为构造函数参数(它是可选的),则库将查找环境变量。

代码使用

<?php
$nipClient = new MWojtowicz\GusClient\NIPClient(<GUS_API_USER_KEY>);
$regonClient = new MWojtowicz\GusClient\RegonClient(<GUS_API_USER_KEY>);
$krsClient = new MWojtowicz\GusClient\KrsClient(<GUS_API_USER_KEY>);

$company   = $nipClient->find('1234567890');
$companies = $nipClient->find(['1234567890', '9876054321']);

$company   = $regonClient->find('1234567890');
$companies = $regonClient->find(['1234567890', '9876054321']);

$company   = $krsClient->find('1234567890');
$companies = $krsClient->find(['1234567890', '9876054321']);