PHPackages                             smartgroup/smart-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. smartgroup/smart-serializer

ActiveLibrary

smartgroup/smart-serializer
===========================

Smart-serializer is a tiny library which allows to serialize PHP objects. It supports routes, translations and nested objects of Symfony.

1.0.3(3y ago)09MITPHPPHP ^8.0

Since Dec 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mtulikowski/smart-serializer)[ Packagist](https://packagist.org/packages/smartgroup/smart-serializer)[ RSS](/packages/smartgroup-smart-serializer/feed)WikiDiscussions master Synced 1mo ago

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

smart-serializer
================

[](#smart-serializer)

It's the tiny library which can be used in any of PHP projects, however it was designed mainly to support Symfony projects (Symfony 6 and above).

How to install
--------------

[](#how-to-install)

Call following command to add it to your project:

```
composer require smartgroup/smart-serializer
```

How to use
----------

[](#how-to-use)

This library is easy to use. For the entity or object which needs to be serialized, just annotate it's properties or methods with `Snapshot` annotation.

```
class Photo
{
    #[Snapshot]
    private ?int $id;

    #[Snapshot]
    private string $locale = 'pl';

    #[Snapshot(isObject: true)]
    private PhotoGallery $photoGallery;

    #[Snapshot]
    private string $title;

    private string $slug;
}
```

Having the code above you will receive a serialized object, which contains fields which are annotated. To receive the serialized object just call:

```
$serializedObject = Serializer::getSnapshot($photoObject, true);
```

Snapshot annotation options
---------------------------

[](#snapshot-annotation-options)

Annotating the object with Snapshot annotation, you have following options:

- isObject - field is an object which should be serialized as well
- isDate - object is a date
- dateFormat - if object is a date you can specify the output format of date, by default it is 'Y-m-d H:i:s'
- fieldName - by default name of the value is the field name, but you can overwrite the name by putting value here
- isRoute - it will parse the value to extract the real route using symfony/router (it requires to pass symfony/router interface to getSnapshot method)
- isCollection - it will extract the value as the serialized collection
- translate - it will translate the value using symfony/translate (it requires to pass symfony/translate interface to getSnapshot method)

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

[](#contributing)

This project is maintained by a community of developers. Contributions are welcome and appreciated. You can find Jodit on GitHub; feel free to start an issue or create a pull requests:

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

4

Last Release

1259d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4678785a3d77a2e4005b6040dbd41491133ac8bf4614615b416daab5b45c5cc3?d=identicon)[mtulikowski](/maintainers/mtulikowski)

---

Top Contributors

[![mtulikowski](https://avatars.githubusercontent.com/u/3591892?v=4)](https://github.com/mtulikowski "mtulikowski (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/smartgroup-smart-serializer/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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