PHPackages                             thevenrex/json-to-class - 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. thevenrex/json-to-class

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

thevenrex/json-to-class
=======================

Json Class initializer

v1.0(1y ago)12MITPHP

Since Sep 30Pushed 1y agoCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

JSON Searializer
================

[](#json-searializer)

Json Decoder into class

First step
----------

[](#first-step)

```
use Thevenrex\JsonToClass\JsonToClassDecoder;
```

Usage
-----

[](#usage)

Create Class with public methods to used in json same

```
class User {
	public int $id;
	public string $name;
	public string $username;
}
```

### Create a new instance of JSON class with json raw

[](#create-a-new-instance-of-json-class-with-json-raw)

```
$json = '{
    "id": 1,
    "name": "John Doe",
    "username": "johndoe"
}';
$decoder = new JsonToClassDecoder($rawJson);
```

### Decode content

[](#decode-content)

```
$user = new User();
$decoder->decode($user);
```

The attributes is changed with json Datas

```
var_dump($user);
```

example output:

```
class User#3 (3) {
  public int $id =>
  int(1)
  public string $name =>
  string(5) "John Doe"
  public string $username =>
  string(10) "johndoe"
}

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

594d ago

### Community

Maintainers

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

---

Top Contributors

[![ThevenRexOff](https://avatars.githubusercontent.com/u/87929242?v=4)](https://github.com/ThevenRexOff "ThevenRexOff (12 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/thevenrex-json-to-class/health.svg)

```
[![Health](https://phpackages.com/badges/thevenrex-json-to-class/health.svg)](https://phpackages.com/packages/thevenrex-json-to-class)
```

PHPackages © 2026

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