Download the PHP package jooservices/dto without Composer
On this page you can find all versions of the php package jooservices/dto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jooservices/dto
More information about jooservices/dto
Files in jooservices/dto
Package dto
Short Description PHP 8.5+ DTO and Data library with immutable DTOs and mutable Data objects
License MIT
Informations about the package dto
jooservices/dto
A PHP 8.5+ attribute-driven DTO and Data library: immutable Dto and mutable Data objects, constructor-first hydration, opt-in validation, serialization control, collections, and JSON Schema / OpenAPI generation. One runtime dependency: psr/http-message (interface-only).
[!WARNING]
v3.0.0is a complete ground-up rebuild of this package and is NOT backward compatible with any previous version (v1.x,v2.x). Rewrite DTO classes for the v3 API before upgrading; there are no legacy shims or deprecation bridges. See the changelog.
Upgrade highlights
- v3 has a new DTO/Data engine, constructor-first hydration, and explicit key-space rules.
jooservices/exceptionsis no longer a runtime dependency;psr/http-messagesupportsfromRequest().with(),merge(), andclone()use property names and rebuild through the constructor.
Features
- Immutable
Dtoand mutableDataobjects with typed, constructor-first hydration. - Factories for arrays, JSON, objects, and PSR-7 requests; collection and partial-payload support.
- Attribute-driven mapping, casting, transforms, validation, and serialization control.
- Immutable copies, merging, comparison, hashing, and lazy derived properties.
- JSON Schema and OpenAPI generation, structured exceptions, and cached reflection metadata.
Requirements
- PHP
>= 8.5 - Extensions:
dom,libxml psr/http-message(fromRequest()), optional:psr/log(Engine debug logging)- Docker (recommended — all local tooling runs in
php:8.5-cli-bookworm)
Installation
Quick start
Design notes
- Every DTO declares a constructor with public promoted properties; constructor-less classes are unsupported.
- Each entry point owns exactly one key space:
| Entry point | Key space |
|---|---|
new UserDto(...) |
Property names — already-typed values |
UserDto::from() / fromArray() / fromJson() / fromObject() / fromRequest() |
Source keys — resolved via MapFrom / naming strategy |
$dto->with(...) / merge(...) |
Property names only — immutable copies built through the constructor |
- Validation is opt-in via
Context; casting and pipelines never silently change scope when a Context argument is omitted.
Documentation
- Changelog — version history and upgrade notes
- Contributing guide — setup, quality gates, and pull requests
- Development workflows — branches, CI, releases, and repository automation
- Security policy — private vulnerability reporting
Development
All PHP tooling runs inside Docker (php:8.5-cli-bookworm via Docker Compose).
| Command | Purpose |
|---|---|
make validate |
composer validate --strict |
make lint |
Pint, PHPCS, PHPStan, PHPMD, PHP-CS-Fixer |
make test |
PHPUnit (Unit + Integration) |
make test-coverage |
PHPUnit with Clover coverage |
make audit |
Composer audit |
make bench |
phpbench |
make ci |
lint + coverage run (local CI parity) |
Every linter runs at maximum strictness with no ignore lists — fix issues at the source instead of suppressing them.
IDE setup: Cursor / VS Code — install recommended workspace extensions; format-on-save runs Pint via tools/pint (Docker). PHPStorm — inspection profile + Pint file watcher.
Community
- Contributing guide — setup, git workflow, commit convention, quality gates, PR rules
- Security policy — how to report vulnerabilities privately
- Code of Conduct
- Support
- Governance
License
MIT — see LICENSE.