PHPackages                             jooservices/dto - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. jooservices/dto

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

jooservices/dto
===============

A PHP 8.5+ DTO and Data library with immutable DTOs and mutable Data objects

v1.0.8(1w ago)01.1k↑837.8%1[2 PRs](https://github.com/jooservices/dto/pulls)9MITPHPPHP &gt;=8.5CI passing

Since Jan 22Pushed 4d agoCompare

[ Source](https://github.com/jooservices/dto)[ Packagist](https://packagist.org/packages/jooservices/dto)[ RSS](/packages/jooservices-dto/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (46)Versions (32)Used By (9)

JOOservices DTO Library
=======================

[](#jooservices-dto-library)

[![codecov](https://camo.githubusercontent.com/e9e53a1e34e5df42715c24f982095304304f0acd64a1cf32b50d64e9e301b6e2/68747470733a2f2f636f6465636f762e696f2f67682f6a6f6f73657276696365732f64746f2f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/jooservices/dto)[![CI](https://github.com/jooservices/dto/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/jooservices/dto/actions/workflows/ci.yml)[![OpenSSF Scorecard](https://camo.githubusercontent.com/5d20c05727f505aec8aa1517dc2ea69ee38e5d7b35330a15c9eecbee56a6c1f0/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f6a6f6f73657276696365732f64746f2f6261646765)](https://securityscorecards.dev/viewer/?uri=github.com/jooservices/dto)[![PHP Version](https://camo.githubusercontent.com/2788132aa1e54031a6c94edcbf8688566d3e18cb5492cd1766836f74a24b27b5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e352532422d626c75652e737667)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/ca29a71f84ecf058bc1a65f859aa2eea828c50d0b2e88601ef9a9dfac62209ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f6f73657276696365732f64746f)](https://packagist.org/packages/jooservices/dto)

The **JOOservices DTO Library** is a PHP 8.5+ library for constructor-based DTO hydration, mutable data objects, opt-in validation, serialization control, and DTO collection wrappers.

Package name: `jooservices/dto`

Latest stable release: `v1.0.8`

Install
-------

[](#install)

```
composer require jooservices/dto
```

Quick example
-------------

[](#quick-example)

```
use DateTimeImmutable;
use JOOservices\Dto\Attributes\MapFrom;
use JOOservices\Dto\Core\Dto;

final class UserDto extends Dto
{
    public function __construct(
        public readonly string $id,
        #[MapFrom('email_address')]
        public readonly string $email,
        public readonly DateTimeImmutable $createdAt,
    ) {}
}

$user = UserDto::from([
    'id' => 'u_123',
    'email_address' => 'john@example.com',
    'createdAt' => '2026-01-15T10:30:00+00:00',
]);

$payload = $user->toArray();
```

What is supported today
-----------------------

[](#what-is-supported-today)

- `Dto` and `Data`
- hydration from arrays, JSON strings, and simple public-property objects
- scalar, enum, and `DateTimeInterface` casting
- nested single DTO hydration
- class-level polymorphic DTO hydration with `#[DiscriminatorMap]`
- typed array hydration from common PHPDoc annotations such as `Type[]`, `array`, and `list`
- fallback property defaults with `#[DefaultFrom]`
- opt-in validation with attributes
- serialization filtering and wrapping
- lazy derived serialization through `ComputesLazyProperties`
- `DataCollection` and `PaginatedCollection`

Important current limitations
-----------------------------

[](#important-current-limitations)

- several declared attributes are still only partially wired into runtime behavior; `Computed`, `Deprecated`, `OptionalProperty`, and `Context::$globalPipeline` remain incomplete, and `Pipeline` support is limited to current property-level execution paths rather than a broader end-to-end pipeline system
- `StrictType` now affects input shape enforcement and implicit casting rules, but related pipeline and schema behavior remains narrower than the declared attribute surface

Documentation
-------------

[](#documentation)

Start with:

- [Documentation Hub](./docs/README.md)
- [Changelog](./CHANGELOG.md)
- [AI Skills Usage Guide](./ai/skills/USAGE.md)
- phpDocumentor config for future API reference generation: [`phpdoc.dist.xml`](./phpdoc.dist.xml)
- [Installation](./docs/01-getting-started/01-installation.md)
- [Quick Start](./docs/01-getting-started/02-quick-start.md)
- [Risks, Legacy, and Gaps](./docs/05-maintenance/01-risks-legacy-and-gaps.md)

AI Support
----------

[](#ai-support)

This repository includes an AI skill pack for agents working in Cursor, Claude Code, VS Code, JetBrains, and Antigravity.

Start with:

- [`AGENTS.md`](./AGENTS.md)
- [`CLAUDE.md`](./CLAUDE.md)
- [AI Skills Map](./ai/skills/README.md)
- [AI Skills Usage Guide](./ai/skills/USAGE.md)

The canonical skill source lives in [`.github/skills/`](./.github/skills/), with adapter layers for each supported AI environment.

Development
-----------

[](#development)

```
composer lint
composer lint:all
composer test
composer test:coverage
composer check
composer ci
```

Contributor workflow details live in:

- [Setup](./docs/04-development/01-setup.md)
- [Contributing](./docs/04-development/07-contributing.md)
- [CI/CD](./docs/04-development/05-ci-cd.md)
- [Release Process](./docs/04-development/06-release-process.md)
- [AI Skills](./docs/04-development/08-ai-skills.md)

Approved Git flow summary:

- normal feature and fix work branches from `develop` and PRs back into `develop`
- release preparation uses `release/` from `develop`, then PRs into `master`
- releases are tagged from `master`
- `master` merges back into `develop` after release or hotfix completion

Community
---------

[](#community)

- [Contributing](./CONTRIBUTING.md)
- [Security Policy](./SECURITY.md)
- [Code of Conduct](./CODE_OF_CONDUCT.md)

GitHub Actions and Services
---------------------------

[](#github-actions-and-services)

Current GitHub Actions coverage:

- `CI`: security checks, linting, tests, 95% minimum statement coverage, coverage upload, and optional SonarQube Cloud analysis when `SONAR_TOKEN` is configured
- `Release`: validate tags, create GitHub releases, trigger Packagist update
- `PR Labeler`: apply labels to pull requests
- `Semantic PR Title`: enforce pull request title format
- `OpenSSF Scorecard`: publish scorecard results as SARIF
- `Secret Scanning`: workflow file exists, but the `gitleaks` job is currently disabled

External services currently used by workflows:

- `Codecov` for coverage upload in [`ci.yml`](./.github/workflows/ci.yml)
- `Packagist` update webhook in [`release.yml`](./.github/workflows/release.yml)
- `GitHub Releases` and `GitHub Discussions` in [`release.yml`](./.github/workflows/release.yml)
- `OpenSSF Scorecard` in [`scorecard.yml`](./.github/workflows/scorecard.yml)
- `GitHub SARIF` upload through CodeQL infrastructure in [`scorecard.yml`](./.github/workflows/scorecard.yml)

Important notes:

- No workflow currently defines Docker-style `services:` containers such as MySQL, Redis, or PostgreSQL.
- SonarQube Cloud analysis is present in `ci.yml`, but it only runs after tests pass and only when `SONAR_TOKEN` is available.

License
-------

[](#license)

This project is licensed under the [MIT License](./LICENSE).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance99

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 89.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Total

8

Last Release

11d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/142772948?v=4)[JOOservices Ltd](/maintainers/jooservices)[@jooservices](https://github.com/jooservices)

---

Top Contributors

[![soulevilx](https://avatars.githubusercontent.com/u/2688707?v=4)](https://github.com/soulevilx "soulevilx (123 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")

---

Tags

castingcollectionscomposer-packagedata-objectdata-transfer-objectdtohydrationjooservicesmappingphpphp85serializationvalidationdatamappingdata-transfer-objectdtocastinghydrationnormalization

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jooservices-dto/health.svg)

```
[![Health](https://phpackages.com/badges/jooservices-dto/health.svg)](https://phpackages.com/packages/jooservices-dto)
```

###  Alternatives

[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

762649.9k18](/packages/wendelladriel-laravel-validated-dto)[event4u/data-helpers

Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and helper classes (MathHelper, EnvHelper, etc.). Works with Laravel, Symfony/Doctrine or standalone PHP.

1431.1k](/packages/event4u-data-helpers)[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1063.4k2](/packages/yorcreative-laravel-argonaut-dto)[fab2s/dt0

Immutable DTOs with bidirectional casting. No framework required. 8x faster than the alternative.

102.3k1](/packages/fab2s-dt0)[friendsofhyperf/validated-dto

The Data Transfer Objects with validation for Hyperf.

1514.8k](/packages/friendsofhyperf-validated-dto)[articus/data-transfer

Library for merging source data to destination data only if destination data remains valid after that

1032.6k4](/packages/articus-data-transfer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
