PHPackages                             gabrielberthier/pieck - 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. gabrielberthier/pieck

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

gabrielberthier/pieck
=====================

The PHP validation library that converts data to Plain Old PHP Objects

v1.0.0(5mo ago)21MITPHPPHP ^8.3.0

Since Jan 16Pushed 5mo agoCompare

[ Source](https://github.com/gabrielberthier/pieck)[ Packagist](https://packagist.org/packages/gabrielberthier/pieck)[ RSS](/packages/gabrielberthier-pieck/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (6)Versions (2)Used By (0)

Pieck
=====

[](#pieck)

Pieck is a validation library that parses incoming payloads into POPOs (Plain Old PHP Objects). Similar to Pydantic, Zod, Class Validator and other libraries, its objective is to convert raw input to idiomatic user-land objects, providing runtime data validation, parsing, and serialization using PHP types, ensuring data conforms to defined schemas for robust applications, especially in APIs, by catching errors early, simplifying complex data handling (like nested JSON and arrays). Also, it provides features like automatic conversion, custom validation, and JSON Schema generation, making PHP code more reliable and developer-friendly.

Requirements
------------

[](#requirements)

PHP 8.3+

Features
--------

[](#features)

✅ Validates data via types

✅ Converts raw arrays/objects into plain objects

✅ Support for custom validation rules

✅ Method validation

✅ Collection/Array conversion

✅ To/From JSON

✅ Out of the box converts DateTime interfaces, array types, scalar types.

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

[](#installation)

```
composer require gabrielberthier/pieck
```

How it works
------------

[](#how-it-works)

It uses reflection to map entries to object properties.

```
