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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. smartgroup/smart-serializer

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

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

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

2.0.0(2mo ago)010MITPHPPHP ^8.2

Since Dec 5Pushed 2mo 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 yesterday

READMEChangelog (5)Dependencies (10)Versions (6)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

42

—

FairBetter than 88% of packages

Maintenance84

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~306 days

Total

5

Last Release

83d ago

Major Versions

1.0.3 → 2.0.02026-04-11

PHP version history (2 changes)v1.0.0PHP ^8.0

2.0.0PHP ^8.2

### 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 (6 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.5k5.9M737](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[open-dxp/opendxp

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

9421.6k61](/packages/open-dxp-opendxp)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[pimcore/pimcore

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

3.8k3.8M508](/packages/pimcore-pimcore)

PHPackages © 2026

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