PHPackages                             ifcastle/type-definitions - 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. ifcastle/type-definitions

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

ifcastle/type-definitions
=========================

Library for defining data types at the business logic layer. Data hydration and serialization based on type definitions.

v0.5.20(1y ago)02387MITPHP

Since Jul 22Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/IFCastle/type-definitions)[ Packagist](https://packagist.org/packages/ifcastle/type-definitions)[ RSS](/packages/ifcastle-type-definitions/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (22)Used By (7)

Type definitions [![PHP Composer](https://github.com/EdmondDantes/type-definitions/actions/workflows/php.yml/badge.svg)](https://github.com/EdmondDantes/amphp-pool/actions/workflows/php.yml)
==============================================================================================================================================================================================

[](#type-definitions-)

A metadata library for describing the types of procedures, services, and objects.

Why is this needed?
-------------------

[](#why-is-this-needed)

Information about data types and method prototypes can be used for code generation, forming `DataTransferObjects`, and remote calls. This library provides an independent infrastructure for forming metadata about data types that is not tied to a specific implementation.

Features
--------

[](#features)

- Classes for describing data types
- Forming metadata through PHP Reflection and attributes.
- Serialization and deserialization of data into a `JSON`-like structure (`JSON-array`).
- `ValueContainer` pattern: a container for storing values with a type descriptor.
- A PHP code generator for serialization, validation, and deserialization for better performance.

Installation
------------

[](#installation)

```
composer require ifcastle/type-definitions
```

Example
-------

[](#example)

```
