cmelda / mpohoda
Strictly typed PHP client for the mPohoda REST API
Fund package maintenance!
Requires
- php: >=8.4
- ext-json: *
- psr/http-client: ^1.0.3
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
Requires (Dev)
- arxeiss/coding-standards: ^0.14.1
- codeception/codeception: ^5.3.5
- codeception/module-asserts: ^3.3
- guzzlehttp/guzzle: ^8.2
- infection/codeception-adapter: ^0.4.7
- infection/infection: ^0.35.4
- phpstan/phpstan: ^2.2.14
- rector/rector: ^2.6.7
- roave/backward-compatibility-check: ^8.21
- symfony/http-client: ^8.1
Suggests
- ext-curl: Use the built-in cURL transport as the final fallback.
- guzzlehttp/guzzle: Use Guzzle 8 as the automatically detected PSR-18 HTTP client.
- symfony/http-client: Use Symfony HTTP Client through SymfonyTransport.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-27 20:52:03 UTC
README
Strictly typed PHP 8.4+ client for the Czech mPohoda REST API. The project is in its initial pre-1.0 development phase and implements all 90 operations in the bundled official OpenAPI contract through 27 typed API groups and 162 generated DTOs/enums.
The bundled, normalized upstream contract is OpenAPI v1.0. Exact snapshot identity is available through composer schema:version; freshness is checked against the official OpenAPI document.
Installation
composer require cmelda/mpohoda
Runtime requirements are PHP 8.4+ and ext-json. Choose Guzzle, Symfony HTTP Client, a custom transport, or the built-in ext-curl fallback.
Quick start
<?php
declare(strict_types=1);
use Cmelda\MPohoda\Authentication\ApiKeyAuthentication;
use Cmelda\MPohoda\MPohodaClient;
use Cmelda\MPohoda\Request\CursorListQuery;
require __DIR__ . '/vendor/autoload.php';
$client = new MPohodaClient(new ApiKeyAuthentication($_ENV['MPOHODA_API_KEY']));
$partners = $client->getBusinessPartners()->list(
new CursorListQuery(pageNumber: 1, pageSize: 100),
);
foreach ($partners->items ?? [] as $partner) {
echo ($partner->companyName ?? $partner->name ?? $partner->id->value) . PHP_EOL;
}
See the documentation index, especially configuration, usage, and errors.
The get*() methods return small typed operation groups: for example getBanks() returns BanksApi, on which list() or get() performs the request. Request DTOs use ::create() for required values and immutable with...() methods for optional values, avoiding long positional constructors. Installed Guzzle 8 or Symfony HTTP Client is detected directly; cURL remains the final fallback. Laravel's HTTP client already installs Guzzle and therefore needs no special adapter. See transport configuration.
Development
Run composer build once after installation, then use composer check. Mutation testing and BC checking are available as composer mutation and composer backward-compatibility. See the changelog and development documentation.
License and funding
Released under the MIT License. You can support development on Ko-fi.

