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 1w 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 59% 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

2266d 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

[giggsey/locale

Locale functions required by libphonenumber-for-php

635141.2M14](/packages/giggsey-locale)[jeroendesloovere/vcard

This VCard PHP class can generate a vCard with some data. When using an iOS device it will export as a .ics file because iOS devices don't support the default .vcf files.

5193.6M12](/packages/jeroendesloovere-vcard)[coderflex/laravel-ticket

Laravel Ticket System, to help you manage your tickets eaisly

43178.0k1](/packages/coderflex-laravel-ticket)[prestashop/ps_shoppingcart

PrestaShop module ps\_shoppingcart

117.6M2](/packages/prestashop-ps-shoppingcart)[prestashop/ps_crossselling

PrestaShop - Cross selling

117.3M2](/packages/prestashop-ps-crossselling)[laracraft-tech/laravel-useful-additions

A collection of useful Laravel additions!

58109.4k](/packages/laracraft-tech-laravel-useful-additions)

PHPackages © 2026

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