PHPackages                             strikebit/json-to-php - 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. strikebit/json-to-php

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

strikebit/json-to-php
=====================

Utility for creating PHP classes from JSON

v1.0.0(6y ago)143979[1 issues](https://github.com/bensonarts/json-to-php-models/issues)1MITPHPPHP ^7.1.3

Since Mar 4Pushed 6y ago3 watchersCompare

[ Source](https://github.com/bensonarts/json-to-php-models)[ Packagist](https://packagist.org/packages/strikebit/json-to-php)[ RSS](/packages/strikebit-json-to-php/feed)WikiDiscussions master Synced 3w ago

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

JSON to PHP model classes
=========================

[](#json-to-php-model-classes)

A tool to generate PSR-2 compliant PHP model classes from JSON. This tool will recursively inspect JSON and generate corresponding classes complete with getters &amp; setters.

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

[](#installation)

If you're wanting this to be a part of your project:

`composer require strikebit/json-to-php`

If you're wanting this to be a standalone tool, clone this repository. Then install dependencies:

`composer install`

Usage
-----

[](#usage)

[Online tool](https://json2php.strikebit.io/)

### Command Line

[](#command-line)

Example: `php ./bin/cli.php ./input-file.json User 1 1 Acme\\Entity > output.txt`

Arguments:

1. Location of your input JSON file.
2. Desired class name
3. Type hinting (0|1)
4. Fluent setters (0|1)
5. Desired namespace (optional)

Contributing
------------

[](#contributing)

### Testing

[](#testing)

[Apache Ant](https://ant.apache.org/) is required.

`ant`

Build errors will appear in build/results.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

2312d ago

### Community

Maintainers

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

---

Top Contributors

[![bensonarts](https://avatars.githubusercontent.com/u/140198?v=4)](https://github.com/bensonarts "bensonarts (8 commits)")

---

Tags

convertergeneratorjsonphp

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/strikebit-json-to-php/health.svg)

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

###  Alternatives

[statamic/collaboration

Real-time collaboration and multi-user authoring for Statamic Pro.

3697.2k](/packages/statamic-collaboration)[p-chess/chess

A PHP chess library that is used for chess move generation/validation, piece placement/movement, and check/checkmate/stalemate detection

476.0k2](/packages/p-chess-chess)

PHPackages © 2026

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