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 2mo 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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

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

2349d ago

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

0.3.5PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5578f15ff14d148f32bfcdb831a9ca6050318283762622a9fac29179886c0f3c?d=identicon)[tsufeki](/maintainers/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

[phpdocumentor/reflection-docblock

With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.

9.4k722.2M1.2k](/packages/phpdocumentor-reflection-docblock)[spatie/laravel-settings

Store your application settings

1.5k5.9M71](/packages/spatie-laravel-settings)[phpdocumentor/reflection

Reflection library to do Static Analysis for PHP Projects

12521.4M108](/packages/phpdocumentor-reflection)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k134](/packages/symfony-ai-platform)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)

PHPackages © 2026

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