Tiny Blocks
Small, focused PHP libraries. Each one solves a single problem and can be adopted on its own, without pulling in the rest.
How the blocks fit together
Every library is a block, and every block stands on the blocks below it. Point at one, or focus it, to see what it stands on and what stands on it.
Domain modeling
The tactical building blocks of Domain Driven Design, value objects and the Transactional Outbox.
- building-blocksImplements tactical DDD building blocks for PHP: entities, aggregate roots, domain events, snapshots, and upcasters.5.3.0used by 1 library
- value-objectDefines the default behavior contract for PHP value objects with structural equality.5.0.2used by 3 libraries
- outboxWrite-side adapter for the Transactional Outbox pattern that persists domain events atomically with aggregate state through Doctrine DBAL.5.1.0
HTTP
PSR-7, PSR-15, PSR-17 and PSR-18 primitives, and the middleware every service rewrites.
- httpImplements PSR-7, PSR-15, PSR-17 and PSR-18 HTTP primitives for PHP, with a fluent response builder, cookies, cache control, and a PSR-18 client facade.7.2.0used by 4 libraries
- http-correlation-idEnsures every HTTP request has a correlation identifier propagated through requests, responses, and logs.2.1.1used by 2 libraries
- http-error-handlerPSR-15 error handler that maps thrown exceptions to structured JSON error responses with optional logging.2.0.1
- http-health-checkPSR-15 liveness and readiness request handlers with configurable health checks for HTTP services.1.1.0
- http-loggingPSR-15 middleware that logs HTTP request and response metadata with request duration.1.3.0
- http-queryTyped, framework-independent toolkit for HTTP collection queries (RSQL filtering, sorting, and offset and cursor pagination) that never touches a data store.2.7.0
Data and values
Collections, mapping, time, exact numbers, money, countries and identifiers.
- collectionModels a type-safe, fluent collection API for PHP with eager and lazy pipelines over arrays, iterators, and generators.2.6.0used by 8 libraries
- mapperMaps PHP objects to and from arrays, JSON, and iterables through reflection and pluggable strategies.3.2.1used by 5 libraries
- timeModels time as immutable value objects for PHP: instants, durations, periods, timezones, and time-of-day, all UTC-normalized.2.7.0used by 6 libraries
- mathArbitrary-precision numbers for PHP, where arithmetic is exact and rounding is explicit.4.0.0
- currencyModels ISO-4217 currencies as a PHP enum, with per-currency fraction digit resolution.2.3.3
- countryProvides ISO 3166-1 country and ISO 3166-2 subdivision value objects for PHP, with Alpha-2, Alpha-3, numeric, and IANA timezone resolution.5.1.0
- ksuidK-Sortable Unique Identifier.2.0.2used by 1 library
- encoderEncoder and decoder for arbitrary data.4.0.2used by 1 library
Infrastructure
Structured logging, environment configuration and disposable containers for tests.
- loggerEmits PSR-3 structured logs for PHP, with correlation tracking, a severity threshold, configurable redaction, and backend-neutral metrics.4.0.0
- environment-variableProvides a type-safe environment variable reader for PHP, with strict integer and boolean conversion.2.0.0
- docker-containerManages Docker containers programmatically for PHP, aimed at integration tests and disposable infrastructure.5.0.1
- One problem eachInstall only what you need. Nothing pulls in the rest.
- Framework agnosticPlain PHP 8.5 and PSR interfaces, no framework required.
- Strictly analyzedPSR-12 and PHPStan at its highest level on every change.
- Fully mutation testedEvery test suite kills every mutant Infection produces.