koren-software / erplybooks-api-php-client
PHP Client to interact with Erply Books API
0.3.0
2023-10-06 20:20 UTC
Requires
- php: ^7.4|^8.1
- php-http/guzzle7-adapter: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.34
- php-coveralls/php-coveralls: ^2.6
- phpmd/phpmd: ^2.8
- phpunit/phpunit: ^10.4
- squizlabs/php_codesniffer: ^3.5
README
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 checkscomposer test
- run PHPUnitcomposer format
- format code against standardscomposer phpcs
- run PHP Codesniffer against PSR-2 standardscomposer phpmd
- run PHP Mess Detectorcomposer docs
- generate docs with PHP Documentator (expectsapigen/apigen
installed globally cause of conflicts)