Download the PHP package componenta/caster without Composer
On this page you can find all versions of the php package componenta/caster. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download componenta/caster
More information about componenta/caster
Files in componenta/caster
Download componenta/caster
More information about componenta/caster
Files in componenta/caster
Vendor componenta
Package caster
Short Description Value casting attributes and resolvers for Componenta
License MIT
Package caster
Short Description Value casting attributes and resolvers for Componenta
License MIT
Please rate this library. Is it a good library?
Informations about the package caster
Componenta Caster
Named value casters and casting pipelines.
Installation
The package declares Componenta\Caster\ConfigProvider in extra.componenta.config-providers.
When componenta/composer-plugin is installed, the provider is added to the generated provider list automatically.
Requirements
- PHP 8.4+
Related Packages
| Package | Why it matters here |
|---|---|
componenta/di |
Uses casters in #[Cast], #[QueryParam(cast: ...)], and similar attributes. |
componenta/validation |
Can validate DTOs after values are normalized by casters. |
componenta/config |
Registers CasterProviderInterface through ConfigProvider. |
What It Provides
CasterInterface: public contract for named value casters.CasterProviderInterface: registry contract for resolving casters by name.CasterProvider: default registry with scalar, string, array, date, enum, hash, and pipeline casters.- Typed exceptions when a value cannot be cast.
Basic Usage
Unknown casters return null:
Parameterized Casters
Pipelines
Use | to chain casters:
Use ? to pass null through the whole downstream chain:
DI Registration
ConfigProvider registers CasterProviderInterface as a factory returning CasterProvider.
All versions of caster with dependencies
PHP Build Version
Package Version
The package componenta/caster contains the following files
Loading the files please wait ...