PHPackages                             tsufeki/kayo-json-mapper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tsufeki/kayo-json-mapper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tsufeki/kayo-json-mapper
========================

Map JSON data to PHP objects

0.3.6(6y ago)02.3k1[2 PRs](https://github.com/tsufeki/kayo-json-mapper/pulls)2MITPHPPHP &gt;=7.1

Since Dec 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/tsufeki/kayo-json-mapper)[ Packagist](https://packagist.org/packages/tsufeki/kayo-json-mapper)[ RSS](/packages/tsufeki-kayo-json-mapper/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (5)Versions (19)Used By (2)

Kayo JSON mapper
================

[](#kayo-json-mapper)

[![Build Status](https://camo.githubusercontent.com/b81d4906fe6bb7ceffef1712026f4febe7cff72e856eab79c95b41167dffa4a6/68747470733a2f2f7472617669732d63692e6f72672f74737566656b692f6b61796f2d6a736f6e2d6d61707065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tsufeki/kayo-json-mapper)

Map JSON data to PHP objects and back. No custom annotations needed.

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

[](#installation)

With [Composer](https://getcomposer.org/):

```
$ composer require tsufeki/kayo-json-mapper

```

Usage
-----

[](#usage)

```
use Tsufeki\KayoJsonMapper\MapperBuilder;

$mapper = MapperBuilder::create()
    ->getMapper();

$serialized = '{"foo": [1, 2], "bar": "baz"}';

// Pass data and the expected type:
$object = $mapper->load(json_decode($serialized), AClass::class);

$serialized2 = json_encode($mapper->dump($object));
```

### Configuration

[](#configuration)

Kayo is designed to load/dump data without the need for special per class configuration such as annotations etc. All necessary information is gathered from reflection and doc comments.

However, its general behaviour can be customized in many ways through [`MapperBuilder`](src/Tsufeki/KayoJsonMapper/MapperBuilder.php) methods.

### Types &amp; loading

[](#types--loading)

All types recognized by phpDocumentor can be loaded, even union type (`A|B`) -- but please note that objects are differentiated on their shape (i.e. properties) so `throwOnMissingProperty(true)` and `throwOnUnknownProperty(true)` are usually necessary.

License
-------

[](#license)

MIT - see [LICENCE](LICENSE).

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

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

Recently: every ~119 days

Total

16

Last Release

2446d ago

PHP version history (2 changes)0.3.2PHP &gt;=7.0

0.3.5PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4078572?v=4)[tsufeki](/maintainers/tsufeki)[@tsufeki](https://github.com/tsufeki)

---

Top Contributors

[![tsufeki](https://avatars.githubusercontent.com/u/4078572?v=4)](https://github.com/tsufeki "tsufeki (77 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tsufeki-kayo-json-mapper/health.svg)

```
[![Health](https://phpackages.com/badges/tsufeki-kayo-json-mapper/health.svg)](https://phpackages.com/packages/tsufeki-kayo-json-mapper)
```

###  Alternatives

[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.4k68.6M277](/packages/nelmio-api-doc-bundle)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[spatie/laravel-settings

Store your application settings

1.5k7.8M183](/packages/spatie-laravel-settings)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k9.8M231](/packages/deptrac-deptrac)[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12526.9M158](/packages/phpdocumentor-reflection)

PHPackages © 2026

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