项目作者: koren-software

项目描述 :
PHP Client to interact with Erply Books API
高级语言: PHP
项目地址: git://github.com/koren-software/erplybooks-api-php-client.git


Actions Status
Coverage Status
Latest Stable Version
Total Downloads
License

Erply Books API PHP client

Install

  1. composer require koren-software/erplybooks-api-php-client

Usage

  1. $token = ''; // Set your API token
  2. $client = new Koren\ErplyBooks\Client($token);

Get many

  1. $response = $client->Invoices()->get(); // Koren\ErplyBooks\Response\ItemsResponse

Get by ID

  1. $response = $client->Invoices()->get(1); // Koren\ErplyBooks\Response\ItemResponse

Predefined interfaces used

  1. $invoices = $client->Invoices()->get(); // Koren\ErplyBooks\Response\ItemsResponse
  2. // Items response is iterable
  3. foreach ($invoices as $invoice) {
  4. // Do something with $invoice
  5. }
  6. // Responses are jsonable
  7. $json = json_decode($response); // json string of all items or item
  8. // Responses are countable
  9. $count = count($response); // integer (how many items were in response)

Development

  • composer build - build by running tests and all code checks
  • composer test - run PHPUnit
  • composer format - format code against standards
  • composer phpcs - run PHP Codesniffer against PSR-2 standards
  • composer phpmd - run PHP Mess Detector
  • composer docs - generate docs with PHP Documentator (expects apigen/apigen installed globally cause of conflicts)