PHPackages                             brettminnie/breakfast-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. brettminnie/breakfast-serializer

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

brettminnie/breakfast-serializer
================================

Library for (de-)serializing data of any complexity to JSON

0.1.0(10y ago)126[4 issues](https://github.com/brettminnie/breakfast-serializer/issues)MITPHPPHP &gt;=5.5CI failing

Since Jul 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/brettminnie/breakfast-serializer)[ Packagist](https://packagist.org/packages/brettminnie/breakfast-serializer)[ RSS](/packages/brettminnie-breakfast-serializer/feed)WikiDiscussions develop Synced 1mo ago

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

breakfast-serializer
====================

[](#breakfast-serializer)

[![Build Status](https://camo.githubusercontent.com/585c37032002be4dfd51a0a92e7021b0bdb063e89bbef3ed1cab0f90fec7290e/68747470733a2f2f7472617669732d63692e6f72672f62726574746d696e6e69652f627265616b666173742d73657269616c697a65722e737667)](https://travis-ci.org/brettminnie/breakfast-serializer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8fba000cd2a879bfc6e792f7920ed57502065693dd5d37660f35d96f3fa6c2f7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62726574746d696e6e69652f627265616b666173742d73657269616c697a65722f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://scrutinizer-ci.com/g/brettminnie/breakfast-serializer/?branch=develop)[![Dependency Status](https://camo.githubusercontent.com/d0912219bfbc6a6e394d22ded00c97aa12eda41edf0650502c22c5bc41f7f69c/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535333738623030376634336263643838393030303333642f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/55378b007f43bcd88900033d)[![Coverage Status](https://camo.githubusercontent.com/c044d01b2aa19b8b9578d417c1c820f4d83367806a649a1f7efa2e9c8d66362e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f62726574746d696e6e69652f627265616b666173742d73657269616c697a65722f62616467652e7376673f6272616e63683d646576656c6f7026736572766963653d676974687562)](https://coveralls.io/github/brettminnie/breakfast-serializer?branch=develop)

A replacement for the other well known serializer, initially we were aiming for backwards compatibility, however it seemed more appropriate to develop a lightweight alternative. We are forgoing the depth of features now to offer something that is easy to configure and works well without any configuration.

### Installation

[](#installation)

`$ composer require brettminnie/breakfast-serializer:0.1.*`

Job done, start enjoying your morning serial!

### Configuration

[](#configuration)

Out the box will do a full depth/breadth recursion and serialize to JSON format, no config is required. It will always serialize with a variable called `className` attached to the object. This is a fully fledged namespace and is required to deserialize. If you want to deserialize from JSON data that is missing this variable it needs to be injected into the object.

### Supported Serialization Formats

[](#supported-serialization-formats)

- JSON
- XML
- PHP Object Notation
- YAML

### Features

[](#features)

- Simple limiting of traversal depth
- Mapping of properties to alternate names and back again
- Excluding of properties from serialization and ignoring them on deserialization
- Simple YAML config format (Yay no slow php annotations!)

Quick and Dirty Example

```

    // To retrieve the json representation json of an object
    $jsonData = BDBStudios\BreakfastSerializer\SerializerFactory::getSerializer()
        ->serialize($myClass);

   // To unserialize
   $myClass = BDBStudios\BreakfastSerializer\SerializerFactory::getSerializer()
        ->deserialize($jsonData);

   //To serialize an object with a limited depth recursion (aka only some of it)
   $jsonData =
      BDBStudios\BreakfastSerializer\SerializerFactory::getSerializer(
         BDBStudios\BreakfastSerializer\IsSerializable::FORMAT_JSON,
         2
      )
      ->serialize($myClass);

```

Further examples in the [documentation](documentation/index.md) directory.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.3% 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

Unknown

Total

1

Last Release

3949d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/839ade9d0c935d4d127dc6879401170e9adefe84d8a698e5c96a0e7556953ebe?d=identicon)[brettminnie](/maintainers/brettminnie)

---

Top Contributors

[![brettminnie](https://avatars.githubusercontent.com/u/6124248?v=4)](https://github.com/brettminnie "brettminnie (159 commits)")[![eddiejaoude](https://avatars.githubusercontent.com/u/624760?v=4)](https://github.com/eddiejaoude "eddiejaoude (11 commits)")[![fpietka](https://avatars.githubusercontent.com/u/150428?v=4)](https://github.com/fpietka "fpietka (6 commits)")

---

Tags

jsonxmlserializationdeserializationjaxb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brettminnie-breakfast-serializer/health.svg)

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

###  Alternatives

[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)

PHPackages © 2026

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