PHPackages                             aaronbullard/php-schema - 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. [Database &amp; ORM](/categories/database)
4. /
5. aaronbullard/php-schema

ActiveLibrary[Database &amp; ORM](/categories/database)

aaronbullard/php-schema
=======================

v1.0.0(7y ago)18MITPHPPHP ^7.1

Since Nov 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/aaronbullard/php-schema)[ Packagist](https://packagist.org/packages/aaronbullard/php-schema)[ RSS](/packages/aaronbullard-php-schema/feed)WikiDiscussions master Synced 2mo ago

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

PhpSchema
=========

[](#phpschema)

[![Maintainability](https://camo.githubusercontent.com/f5ebc885cbe6686e94cfafde2d74d23d92a6b7aca3096c1f8ba56b7b71c80548/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31663230626536333034353766653662336335372f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/aaronbullard/php-schema/maintainability)[![Test Coverage](https://camo.githubusercontent.com/6828a0492251239c79c32b5e7797ce4ca04089e24f2b0489a903cb042cb6f8c2/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31663230626536333034353766653662336335372f746573745f636f766572616765)](https://codeclimate.com/github/aaronbullard/php-schema/test_coverage)

Self validating PHP objects from JSON Schema

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

[](#installation)

### Library

[](#library)

```
git clone https://github.com/aaronbullard/php-schema.git
```

### Composer

[](#composer)

[Install PHP Composer](https://getcomposer.org/doc/00-intro.md)

```
composer require aaronbullard/php-schema
```

### Testing

[](#testing)

```
composer test
```

Usage
-----

[](#usage)

PhpSchema provides a quick solution to roll objects from JSON Schema.

Objects self validate during construction and when mutated.

In keeping with DDD principles, PhpSchema objects should always be in a valid state. Therefore all required properties must be passed through the constructor. Any optional properties can be passed after instantiation.

Validation is built off of JsonSchema\\Validator from justinrainbow/json-schema

Examples
--------

[](#examples)

1. [PublicProperties](docs/public-properties.md) Trait
2. [MethodAccess](docs/method-access.md) Trait
3. Converting to [Array, Json, or StdClass](converter.md)
4. [Integrating](docs/non-phpschema.md) with non-PhpSchema classes

For more examples, see the tests: `tests\ModelTest.php`

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

Unknown

Total

1

Last Release

2741d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/085d40a129f9424a85543852f2c8d2d6cdce7e3f0e4fe6b058ea7eb51edae400?d=identicon)[aaronbullard](/maintainers/aaronbullard)

---

Top Contributors

[![aaronbullard](https://avatars.githubusercontent.com/u/4197300?v=4)](https://github.com/aaronbullard "aaronbullard (64 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aaronbullard-php-schema/health.svg)

```
[![Health](https://phpackages.com/badges/aaronbullard-php-schema/health.svg)](https://phpackages.com/packages/aaronbullard-php-schema)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)[mediawiki/semantic-media-wiki

An extension to MediaWiki that lets you store and query structured data within wiki pages

586361.8k33](/packages/mediawiki-semantic-media-wiki)

PHPackages © 2026

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