poagen / client-runtime
Marshalling, transport and attribute runtime for clients generated by poagen.
Requires
- php: ^8.4
- ext-dom: *
- ext-json: *
- php-http/discovery: ^1.20
- phpstan/phpdoc-parser: ^2.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.92
- nyholm/psr7: ^1.8
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^12.1
- ramsey/uuid: ^4.7
- rector/rector: ^2.3
- symfony/uid: ^7.0
Suggests
- ramsey/uuid: Bind format: uuid to ramsey/uuid via Poagen\Runtime\Format\RamseyUuidCodec
- symfony/uid: Bind format: uuid to symfony/uid via Poagen\Runtime\Format\SymfonyUuidCodec
Provides
None
Conflicts
None
Replaces
None
README
Marshalling, transport and attribute runtime for clients generated by poagen.
⚠️ Pre-alpha. API is unstable.
About
poagen/client-runtime is the small, dependency-light package every client
poagen generates depends on at
runtime. It carries no code generation logic of its own — nothing here
knows what an OpenAPI document is — only the machinery a generated client
calls into:
Endpoint/ResponseType— a generated operation describes its request as anEndpointand the shape it expects back as aResponseType, and hands both to an injectedTransportInterface.Envelope— every operation returns one, carrying the HTTP status the wire sent, the body hydrated into the shape the document declared for that status, and the PSR-7 response both came from. A declared status is a return value, never a throw; a profile'sGenerated\ApiExceptionis raised only for a status the document declared nothing for, or a declared body that failed to hydrate.Marshaller/Hydrator— a shared pair driving every (de)serialisation via phpdoc types and a small set of runtime attributes (#[WireName],#[Discriminator],#[AdditionalProperties], …). Model classes generated against this runtime carry no generator boilerplate of their own.- Replaceable — every runtime collaborator a generated file names is an
interface under
src/Contract/, and generated type-hints point at those rather than at implementations. Supply your own hydrator, marshaller, XML writer, descriptor parser or error policy — or your own transport for all of it.
This package is a consumer of PSR-7 / PSR-17 / PSR-18 only — plug in Guzzle, Symfony HTTP Client, or anything else that implements them.
Installation
composer require poagen/client-runtime
Development
The package is developed in the
poagen repository, where it lives
as runtime/, and is fully self-contained: its composer.json, test suite,
and every lint/static-analysis/formatting config are scoped to this tree
alone, with the generator absent.
For a standalone checkout, git subtree split --prefix=runtime from the
parent repository produces exactly this tree.
composer install just check # lint + test with the coverage floor enforced just format # auto-fix code style
License
MIT © Maxim Lavrinenko. See LICENSE.