fev / serializer
Simple library for serialize/un(de)serialize JSON, YAML, XML.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.4
- ext-json: ^7.4
- symfony/yaml: ^5.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
This package is auto-updated.
Last update: 2024-05-16 21:08:25 UTC
README
Installation
For using this library just execute the following command
$ composer require fev/serializer
Usage
For usage this library you need use 2 clases:
SerializeJson
for JSON data
SerializeYAML
for YAML data
both classes have 2 general methods:
SerializeToFormat
and UnserializeFromEncodedFormat
SerializeToFormat($data)
- encode you data.
UnserializeFromEncodedFormat($str)
- decode you data.
XML not implement yet.
Extension
For extended this library create new class from class AbstractSerialize
and define 2 general methods SerializeToFormat
and UnserializeFromEncodedFormat
for you type of data.
Tests
You can run tests with next command
$ php test-json.php
for JSON data.
$ php test-yaml.php
for YAML data.
$ php test-xml.php
for XML data (Not implement yet).
License
This project is released under the terms of the BSD-3-Clause license.
Copyright (c) 2020, FEV