PHPackages                             coretsia/core-dto-attribute - 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. [Framework](/categories/framework)
4. /
5. coretsia/core-dto-attribute

ActiveLibrary[Framework](/categories/framework)

coretsia/core-dto-attribute
===========================

Canonical Coretsia DTO marker attribute for explicit transport-shape opt-in.

v0.4.0(2w ago)01Apache-2.0PHPPHP ^8.4

Since May 9Pushed 2w agoCompare

[ Source](https://github.com/coretsia/core-dto-attribute)[ Packagist](https://packagist.org/packages/coretsia/core-dto-attribute)[ RSS](/packages/coretsia-core-dto-attribute/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

coretsia/core-dto-attribute
===========================

[](#coretsiacore-dto-attribute)

`coretsia/core-dto-attribute` provides the canonical DTO marker attribute for explicit Coretsia DTO opt-in.

The package is intentionally tiny: it defines the marker only and does not provide validation, serialization, hydration, normalization, mapping, dependency injection, runtime discovery, or transport execution.

This repository is a split package generated from the Coretsia monorepo package `framework/packages/core/dto-attribute`.

**Scope:** explicit DTO opt-in marker only.

**Out of scope:** validation, serialization, hydration, normalization, runtime mapping, service behavior, domain modeling, and transport execution.

Package identity
----------------

[](#package-identity)

- **Monorepo source path:** `framework/packages/core/dto-attribute`
- **Split repository:** `coretsia/core-dto-attribute`
- **Package id:** `core/dto-attribute`
- **Composer name:** `coretsia/core-dto-attribute`
- **Namespace:** `Coretsia\Dto\Attribute\*` (PSR-4: `src/Attribute/`)
- **Kind:** library

Versioning is monorepo-wide.

The monorepo tag `vMAJOR.MINOR.PATCH` is the single version source of truth, and the split repository receives the same tag for the corresponding package subtree.

Per-package independent versions MUST NOT be used.

Dependency policy
-----------------

[](#dependency-policy)

This package is intentionally minimal.

- **Depends on:** PHP only
- **Forbidden:**
    - `core/*` runtime implementations
    - `platform/*`
    - `integrations/*`
    - `devtools/*`

The package MUST NOT depend on validators, serializers, hydrators, mappers, containers, platform adapters, or tooling packages.

DTO marker
----------

[](#dto-marker)

The canonical DTO marker is:

```
#[Coretsia\Dto\Attribute\Dto]
```

The attribute targets classes only.

A class marked with this attribute explicitly opts into Coretsia DTO policy and is subject to DTO gates.

Unmarked classes are outside DTO gate scope unless a future policy explicitly says otherwise.

DTO policy
----------

[](#dto-policy)

A DTO is a narrow transport shape.

A DTO is not:

- a value object by default;
- a domain model;
- a service;
- a validator;
- a stateful runtime object;
- a runtime descriptor by default;
- a result object by default;
- a contract shape by default.

Marking a class as DTO means the class must follow the canonical DTO rules documented in the Coretsia monorepo:

```
docs/ssot/dto-policy.md

```

In this split repository, that document is not copied locally. The monorepo remains the source of truth for SSoT policy documents.

Design constraints
------------------

[](#design-constraints)

The marker attribute is intentionally behavior-free.

It MUST NOT provide:

- validation logic;
- serialization logic;
- hydration logic;
- normalization logic;
- mapping logic;
- dependency injection behavior;
- runtime discovery behavior;
- transport-specific behavior.

DTO gates and static-analysis tooling consume the marker externally.

Usage
-----

[](#usage)

```
