PHPackages                             gideonazure/class\_serializer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. gideonazure/class\_serializer

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

gideonazure/class\_serializer
=============================

This is a project for class serialization

v2.0.0(5y ago)04MITPHPPHP &gt;=7.3

Since Aug 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/gideonazure/phpa_serialize)[ Packagist](https://packagist.org/packages/gideonazure/class_serializer)[ RSS](/packages/gideonazure-class-serializer/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Class Serializer
================

[](#class-serializer)

This project based on a default structure for PHP projects and help to serialize any class into JSON, YAML or XML formats.

Installation
------------

[](#installation)

Use the composer [package](https://packagist.org/packages/gideonazure/class_serializer) to install class serializer.

```
composer require gideonazure/class_serializer
```

Usage
-----

[](#usage)

```
// require needed class to your project
use Serialize\SerializeJson;
use Serialize\SerializeYaml;
use Serialize\SerializeXml;

// create instance of a class
// with specifying the format of the final data as a class property

// for JSON output data
$JSON = new SerializeJson();

// for YAML output data
$YAML = new SerializeYaml();

// for XML output data
$XML = new SerializeXml();

// and then call  "serialize" method of instance
// with passing data object

// return class object in JSON format
$JSON->serilalize(/* class object */);

// return class object in YAML format
$YAML->serilalize(/* class object */);

// return class object in XML format
$XML->serilalize(/* class object */);

// if need catch errors and return message use try->catch construction:
try {
    $JSON->serilalize(/* class object */);
} catch (\Exception $e){
    echo $e->getMessage();
}
```

Demo
----

[](#demo)

For demo use and check the functionality - run the file "SerializeTester.php" from the "/tests" folder

```
php SerializeTester.php
```

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2100d ago

Major Versions

v1.0.1 → v2.0.02020-08-16

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31158436?v=4)[gideonazure](/maintainers/gideonazure)[@gideonazure](https://github.com/gideonazure)

---

Top Contributors

[![gideonazure](https://avatars.githubusercontent.com/u/31158436?v=4)](https://github.com/gideonazure "gideonazure (13 commits)")

---

Tags

serializeclassesproject

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/gideonazure-class-serializer/health.svg)

```
[![Health](https://phpackages.com/badges/gideonazure-class-serializer/health.svg)](https://phpackages.com/packages/gideonazure-class-serializer)
```

###  Alternatives

[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[zumba/json-serializer

Serialize PHP variables, including objects, in JSON format. Support to unserialize it too.

129743.7k13](/packages/zumba-json-serializer)[pmjones/throwable-properties

Copies properties of a Throwable to a serializable object.

1554.7k2](/packages/pmjones-throwable-properties)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
