PHPackages                             ritalin/php-json-subset-encoder - 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. ritalin/php-json-subset-encoder

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

ritalin/php-json-subset-encoder
===============================

0.2.4(10y ago)022MITPHPPHP &gt;=5.5.0

Since Jun 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ritalin/php-json-subset-encoder)[ Packagist](https://packagist.org/packages/ritalin/php-json-subset-encoder)[ RSS](/packages/ritalin-php-json-subset-encoder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

php-json-subset-encoder
=======================

[](#php-json-subset-encoder)

JSON encoding support library for nested object and assoc array

Requirements
------------

[](#requirements)

php &gt;= 5.5.x

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

[](#installation)

Omelet can be installed with Composer.

Define the following requirement in your composer.json file:

{ "require": { "ritalin/php-json-subset-encoder ": "\*" } }

Quick Start
-----------

[](#quick-start)

1. Create filter rule.

    ```
    $meta =
        \JsonEncoder\FilterRule::newRule()
        ->includes(['intField'])
        ->nestRule([
            'objField' => \JsonEncoder\FilterRule::newRule()->includes(['b', 'c'])
        ]);
    ```
2. Build serializer.

    ```
    // For example, object array.

    $values = [
        new NestObject('www', 10, new SomeObject('a', 'b', 'c')),
        new NestObject('xxx', 20, new SomeObject('o', 'p', 'q')),
        new NestObject('@@@', 30, new SomeObject('x', 'y', 'z'))
    ];

    $serializer = EncoderBuilder::AsObjectArray($meta)->build($values);
    ```
3. Encode as JSON.

    ```
    $json = json_encode($serializer);
    ```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

7

Last Release

4001d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/784f7b6aed00f8db7c1dd3950a5b52d1c88fb1d5a5bd301b520084253a27aa39?d=identicon)[ritalin](/maintainers/ritalin)

---

Top Contributors

[![ritalin](https://avatars.githubusercontent.com/u/908072?v=4)](https://github.com/ritalin "ritalin (1 commits)")

---

Tags

json

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ritalin-php-json-subset-encoder/health.svg)

```
[![Health](https://phpackages.com/badges/ritalin-php-json-subset-encoder/health.svg)](https://phpackages.com/packages/ritalin-php-json-subset-encoder)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k316.9M612](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[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)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30422.2M45](/packages/colinodell-json5)[clue/ndjson-react

Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.

15267.7M16](/packages/clue-ndjson-react)

PHPackages © 2026

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