Download the PHP package andreiavrammsd/serializer without Composer
On this page you can find all versions of the php package andreiavrammsd/serializer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download andreiavrammsd/serializer
More information about andreiavrammsd/serializer
Files in andreiavrammsd/serializer
Download andreiavrammsd/serializer
More information about andreiavrammsd/serializer
Files in andreiavrammsd/serializer
Vendor andreiavrammsd
Package serializer
Short Description JSON string to object. Object/array to JSON.
License MIT
Package serializer
Short Description JSON string to object. Object/array to JSON.
License MIT
Please rate this library. Is it a good library?
Informations about the package serializer
PHP Serializer
Very basic serializer/unserializer/toarray. Also transforms data by types and/or callbacks.
Currently handles only JSON.
Install
Usage
See tests.
Property annotations (all annotations are optional)
- Property: name of key in input. If not set, the variable name is used.
- Type: If set, the value will be transformed as follows
- int, float, string, bool, array: will cast value to the type.
- collection: value will be wrapped by a countable iterator with array access.
- DateTime: creates a DateTime object, formatting the value by formats given as arguments; first valid format is used.
- Fully qualified class name: the value will be parsed into the given class.
- Array of class: the value will be parsed into an array with each element parsed into the given class.
- Collection of class: the value will be parsed into a collection with each element parsed into the given class.
- Callback: A callable (function or class method) is accepted (with optional parameters). The value will be passed to the callable (with the optional parameters, if set), and the new value will be the result of the callable.
Examples
Object class annotations
- Collection: a class annotated with Collection and extending the Collection class will be a collection class with its items of the specified class type.
Examples
Development
- Requirements: Docker, Make
- Build and install dev container:
make build PHPVERSION=7.4
make install PHPVERSION=7.4
- Run QA tools:
make PHPVERSION=7.4
- Work inside dev container:
make run PHPVERSION=7.4
thenmake localqa
- Remove Docker image:
make clean PHPVERSION=7.4
Developed with PhpStorm
All versions of serializer with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.1
ext-json Version *
ext-json Version *
The package andreiavrammsd/serializer contains the following files
Loading the files please wait ....