koren-software/erplybooks-api-php-client

PHP Client to interact with Erply Books API

0.3.0 2023-10-06 20:20 UTC

This package is auto-updated.

Last update: 2024-11-06 22:36:58 UTC


README

Actions Status Coverage Status Latest Stable Version Total Downloads License

Erply Books API PHP client

Install

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

Usage

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

Get many

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

Get by ID

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

Predefined interfaces used

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

// Items response is iterable
foreach ($invoices as $invoice) {
    // Do something with $invoice
}

// Responses are jsonable
$json = json_decode($response); // json string of all items or item

// Responses are countable
$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)