PHPackages                             flashport/json-marshaller - 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. flashport/json-marshaller

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

flashport/json-marshaller
=========================

A simple JSON Marshaller/Unmarshaller library.

v0.0.13(1y ago)31.2k↓100%1MITPHPPHP &gt;=8.1

Since Jan 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/flashport/json-marshaller)[ Packagist](https://packagist.org/packages/flashport/json-marshaller)[ RSS](/packages/flashport-json-marshaller/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (14)Used By (1)

JSON Marshaller
===============

[](#json-marshaller)

---

This lib provides marshalling and unmarshalling functionality, allowing JSON strings to be cast into objects or vice versa.

### Usage:

[](#usage)

Object example:

```
class Person{

    // It supports custom property names
    #[JsonProperty("fullName")]
    public string $name;

    // It also supports validation attributes
    #[JsonValidateRequired]
    public string $email;

    // Equals can be a single value or an array
    #[JsonValidateEquals(["active", "inactive"])]
    public string $status;

    // It is necessary to define the array type
    #[JsonPropertyType(Address::class)]
    public array $addresses;

    // For array with scalar types
    #[JsonPropertyType(ScalarTypes::INTEGER)]
    public array $luckyNumbers;

    // The type can be inferred from the property, or from the attribute.
    // At least one is required
    public Address $billingAddress;

    #[JsonPropertyType(Address::class)]
    public $shippingAddress;
}
```

Marshalling:

```
$json = new \JsonMarshaller\JsonMarshaller();
$jsonString = $json->marshal($myObject);
```

Unmarshalling:

```
$json = new \JsonMarshaller\JsonMarshaller();
$person = $json->unmarshal($jsonString, Person::class)
```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance45

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

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

Recently: every ~122 days

Total

13

Last Release

462d ago

PHP version history (2 changes)v0.0.1PHP &gt;=8.0

v0.0.8PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/dfc8b9259d31ddeac028b95da0840456fbd146ba78000c1f7a0e304635b2b6b0?d=identicon)[lscarpi](/maintainers/lscarpi)

---

Top Contributors

[![lscarpi](https://avatars.githubusercontent.com/u/2413555?v=4)](https://github.com/lscarpi "lscarpi (19 commits)")

---

Tags

phpjsonpackagemarshaller

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/flashport-json-marshaller/health.svg)

```
[![Health](https://phpackages.com/badges/flashport-json-marshaller/health.svg)](https://phpackages.com/packages/flashport-json-marshaller)
```

###  Alternatives

[adhocore/json-fixer

Fix/repair truncated JSON data

51543.2k2](/packages/adhocore-json-fixer)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[blancks/fast-jsonpatch-php

Class designed to efficiently handle JSON Patch operations in accordance with the RFC 6902 specification

396.4k](/packages/blancks-fast-jsonpatch-php)[josantonius/json

PHP simple library for managing Json files.

1621.6k10](/packages/josantonius-json)[leonelquinteros/php-toml

PHP parser for TOML language ( https://github.com/toml-lang/toml )

266.7k](/packages/leonelquinteros-php-toml)

PHPackages © 2026

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