PHPackages                             mapado/request-fields-parser - 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. mapado/request-fields-parser

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

mapado/request-fields-parser
============================

Convert string like `id,firstname,lastname,jobs{startDate,position,company{id,recordNumber}}` to the array

v3.1.0(2y ago)212.8k↓50%proprietaryPHPPHP ^8.1

Since Feb 12Pushed 2y ago2 watchersCompare

[ Source](https://github.com/mapado/request-fields-parser)[ Packagist](https://packagist.org/packages/mapado/request-fields-parser)[ RSS](/packages/mapado-request-fields-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (9)Used By (0)

request-fields-parser
=====================

[](#request-fields-parser)

Convert string like `id,firstname,lastname,jobs{startDate,position,company{id,recordNumber}}` to the following array:

```
[
    'id' => true,
    'firstname' => true,
    'lastname' => true,
    'jobs' => [
        'startDate' => true,
        'position' => true,
        'company' => [
            'id' => true,
            'recordNumber' => true,
        ],
    ]
]
```

You can think of it like an [explode](https://php.net/explode) on steroids.

Also implement a `reverseParse` function for the opposite transformation.

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

[](#installation)

```
composer require mapado/request-fields-parser
```

Usage
-----

[](#usage)

```
use Mapado\RequestFieldsParser\Parser;

$parser = new Parser();

$outArray = $parser->parse($string);

$outString = $parser->reverseParse($array);
```

Extensibility
-------------

[](#extensibility)

You can decorate the Parser like this:

```
use Mapado\RequestFieldsParser\ParserInterface;

class ExtendedParser implements ParserInterface
{
    /**
     * @var ParserInterface
     */
    private $decoratedParser;

    public function __construct(ParserInterface $decoratedParser)
    {
        $this->decoratedParser = $decoratedParser;
    }

    public function parse(string $string): array
    {
        // do stuff and return an array
    }
}
```

Contribute
----------

[](#contribute)

Just run `make test` to launch the test suite

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 79.4% 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 ~303 days

Recently: every ~23 days

Total

8

Last Release

892d ago

Major Versions

v1.1.0 → v2.0.02022-11-18

v2.0.0 → v3.0.02023-09-07

PHP version history (3 changes)v1.1.0PHP ^7.0

v2.0.0PHP ^7.0||^8.1

v3.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3277986d0e1f93c7e8a58fdaf1b52e3f5a1588e73dfa298d33aafb1ebbde5ef2?d=identicon)[jdeniau](/maintainers/jdeniau)

![](https://www.gravatar.com/avatar/90d135128b469dc38fcf186ac78d0f2cd82fc696ffcf5be8a8c486b7bd911ff6?d=identicon)[mapado](/maintainers/mapado)

---

Top Contributors

[![jdeniau](https://avatars.githubusercontent.com/u/1398469?v=4)](https://github.com/jdeniau "jdeniau (50 commits)")[![Nickinthebox](https://avatars.githubusercontent.com/u/2796997?v=4)](https://github.com/Nickinthebox "Nickinthebox (7 commits)")[![bjulien](https://avatars.githubusercontent.com/u/3918730?v=4)](https://github.com/bjulien "bjulien (6 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mapado-request-fields-parser/health.svg)

```
[![Health](https://phpackages.com/badges/mapado-request-fields-parser/health.svg)](https://phpackages.com/packages/mapado-request-fields-parser)
```

###  Alternatives

[jms/serializer

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

2.3k135.8M851](/packages/jms-serializer)[coduo/php-matcher

PHP Matcher enables you to match values with patterns

84312.5M46](/packages/coduo-php-matcher)[creof/geo-parser

Parser for geography coordinate strings

624.4M15](/packages/creof-geo-parser)[creof/wkt-parser

Parser for well-known text (WKT) object strings

554.8M16](/packages/creof-wkt-parser)[egeloen/serializer

Serializer for PHP 5.6+ supporting JSON, XML, YAML &amp; CSV

28574.6k3](/packages/egeloen-serializer)

PHPackages © 2026

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