Download the PHP package maxiviper117/dtokit-core without Composer
On this page you can find all versions of the php package maxiviper117/dtokit-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maxiviper117/dtokit-core
More information about maxiviper117/dtokit-core
Files in maxiviper117/dtokit-core
Package dtokit-core
Short Description Framework-agnostic typed data boundaries for PHP
License MIT
Homepage https://github.com/Maxiviper117/DTOkit
Informations about the package dtokit-core
DTOKit
DTOKit provides framework-agnostic typed data boundaries for PHP 8.4+. It maps arrays and objects into immutable data objects, serializes them safely, and explains mapping decisions and failures.
Installation
Basic usage
InputData rejects unknown fields by default. Data and OutputData ignore them. Use #[Strict] or #[IgnoreUnknown] to override this per class.
Mapping and serialization
- Supported sources: associative arrays,
stdClass, and public properties of plain objects. - Supported values: typed scalars, nullable/defaulted fields, backed enums,
DateTimeInterface, nested DTOKit objects, and lists declared with#[ListOf]. #[MapInputName]and#[MapOutputName]define external names.#[WithCast]and#[WithTransformer]invoke container-free extension classes.#[Hidden],#[Sensitive], and#[Redact]control safe output.- Nullable accepts explicit
null; only a constructor default makes a missing field optional.
Non-throwing and explain APIs
Data::tryFrom() returns a MappingResult. Data::explain() returns an ExplainResult with toArray(), toJson(), and toText() renderers. Diagnostics contain paths and types but never raw sensitive values.
Development
See AGENTS.md for repository rules.