nokimaro / draperstudio-payload
Serialisers/Deserialisers for several data-types
dev-master / 1.0.x-dev
2016-10-18 11:00 UTC
Requires
- php: ^5.5.9 || ^7.0
- league/csv: ^8.0
- netresearch/jsonmapper: ^0.10
- symfony/property-access: ^2.7|^3.0
- symfony/serializer: ^2.7|^3.0
- symfony/yaml: ^2.7|^3.0
Requires (Dev)
- phpunit/phpunit: ^4.8 || ^5.0
- scrutinizer/ocular: ~1.1
- squizlabs/php_codesniffer: ~2.3
This package is not auto-updated.
Last update: 2025-04-16 22:54:19 UTC
README
Install
Via Composer
$ composer require draperstudio/payload
Usage
Serialise an input
(new Arr())->serialise($input); (new Csv())->serialise($input); (new Ini())->serialise($input); (new Json())->serialise($input); (new Value())->serialise($input); (new Xml())->serialise($input); (new Yaml())->serialise($input); (new YamlInline())->serialise($input);
Unserialise an input
(new Arr())->unserialise($contents, $class); (new Csv())->unserialise($contents, $class); (new Ini())->unserialise($contents, $class); (new Json())->unserialise($contents, $class); (new Value())->unserialise($contents, $class); (new Xml())->unserialise($contents, $class); (new Yaml())->unserialise($contents, $class);
Read a file and unserialise its contents
(new Arr())->read($path, $class); (new Csv())->read($path, $class); (new Ini())->read($path, $class); (new Json())->read($path, $class); (new Value())->read($path, $class); (new Xml())->read($path, $class); (new Yaml())->read($path, $class);
Serialise an input and write it into a file
(new Arr())->write($path, $input); (new Csv())->write($path, $input); (new Ini())->write($path, $input); (new Json())->write($path, $input); (new Value())->write($path, $input); (new Xml())->write($path, $input); (new Yaml())->write($path, $input); (new YamlInline())->write($path, $input);
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email hello@draperstudio.tech instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.