Download the PHP package gabrielberthier/pieck without Composer

On this page you can find all versions of the php package gabrielberthier/pieck. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package 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

PHP 8.3+

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

How it works

It uses reflection to map entries to object properties.

Also, it is possible to extend DataClass (in a pydantic-link fashion) to use methods as modelValidate, modelValidateJson, toJson and modelDump.

Attributes

Take advantage of attributes to extend properties and validations. Pieck comes with two main Attributes: Field and Validate. Field declares how a property should be treated and Validate declares how to validate a class based on methods.

Field

Target: properties.

Properties:

Validate

Target: methods.

Properties:

Use this to validate the object's own properties, income values and to set behaviours while in validation.

Example:

Validate specific field:

If you raise an AssertionError, it will be converted in an error message:

Custom Rules

Declare custom rules and pass them to Field attribute, just like:


All versions of pieck with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gabrielberthier/pieck contains the following files

Loading the files please wait ...