Download the PHP package phrity/util-transformer without Composer
On this page you can find all versions of the php package phrity/util-transformer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download phrity/util-transformer
More information about phrity/util-transformer
Files in phrity/util-transformer
Download phrity/util-transformer
More information about phrity/util-transformer
Files in phrity/util-transformer
Vendor phrity
Package util-transformer
Short Description Type transformers, normalizers and resolvers.
License MIT
Homepage https://phrity.sirn.se/util-transformer
Package util-transformer
Short Description Type transformers, normalizers and resolvers.
License MIT
Homepage https://phrity.sirn.se/util-transformer
Please rate this library. Is it a good library?
Informations about the package util-transformer
Introduction
Type transformers, normalizers and resolvers.
Installation
Install with Composer;
How to use
All transformers exposes canTransform()
and transform()
methods.
This allows us to transform data of a certain type to another type. A specific transformer may not be able to transform all types.
As option, a transformer can take a target type specifier as second argument.
Utility resolvers enable stacking multiple transformers and performing other tasks.
List of transformers in this library
Encoders & Decoders
- Flatten Decoder - Expands array with flattened keys to nested array
- Json Decoder - Decodes JSON string
Type converters
- Basic Type - Support transforming all PHP types to all other types
- DateTime - Transform DateTime classes to string
- Enum - Transform Enums to string
- Json Serializable - Transform JSON serializable objects
- Readable - Transform booleans and null to readable strings
- Reversed Readable - Transform some strings to boolean and null
- Stringable - Transform stringable objects to string
- Throwable - Transform throwable to object, array or string
Utility resolvers
- Chained - Collection of transformers that will send output from one into next one
- First Match - Collection of transformers that will use first compatible transformer for transformation
- Recursion - Will apply transformer recursively
- String - Fold anything to a string
Wrappers
- Symfony Normalizer - Wrap class implementing Symfony
NormalizerInterface
Versions
Version | PHP | |
---|---|---|
1.3 |
^8.1 |
Transformer: DateTime, Resolver: Chained, String |
1.2 |
^8.1 |
Additional transformers |
1.1 |
^8.1 |
Additional transformers |
1.0 |
^8.1 |
Initial version |
All versions of util-transformer with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package phrity/util-transformer contains the following files
Loading the files please wait ....