PHPackages                             activerules/nugget - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. activerules/nugget

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

activerules/nugget
==================

Validate complex JSON objects and process them on change.

01

Since Jan 28Compare

[ Source](https://github.com/bwinkers/nugget)[ Packagist](https://packagist.org/packages/activerules/nugget)[ RSS](/packages/activerules-nugget/feed)WikiDiscussions Synced 2w ago

READMEChangelogDependenciesVersions (6)Used By (0)

nugget
======

[](#nugget)

[![Coverage Status](https://camo.githubusercontent.com/860e6210b70d3c8d2103a04d08f38e9a63b7ab83b062231e18536708458b3d9f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6277696e6b6572732f6e75676765742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/bwinkers/nugget?branch=master)[![Maintainability](https://camo.githubusercontent.com/a2117e5b81c155d08b885a57d48f27771a3b1b5ee7a1af0efc878a0369bc466e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61613061346439376262336166386430613761362f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/bwinkers/nugget/maintainability)[![Test Coverage](https://camo.githubusercontent.com/0fe1c8b3b4ce36d4ed33764f5dcc129dc2304cff2764164a5090a72e477f8b12/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61613061346439376262336166386430613761362f746573745f636f766572616765)](https://codeclimate.com/github/bwinkers/nugget/test_coverage)

A PHP7 library for defining, validating and processing JSON business objects.

The ActiveRules Nugget Schema treats all data as `nuggets`. These `nuggets` can be defined, and related using JSON files. Rules can then be applied to any changes to an object.

The resulting schema will be moving to dataencyclopedia.com.

Testing
-------

[](#testing)

Local only tests (run by Travis CI)
-----------------------------------

[](#local-only-tests-run-by-travis-ci)

`php vendor/bin/phpunit`

Using remote schema (broken on Travis CI)
-----------------------------------------

[](#using-remote-schema-broken-on-travis-ci)

`php vendor/bin/phpunit tests/Activerules/Nugget/NuggetTest-Dev.php --testdox`

Generate Open API schema objects
--------------------------------

[](#generate-open-api-schema-objects)

ActiveRules object definitions are converted to Open API schema objects composed of property definitions.

### Schema from object definitions

[](#schema-from-object-definitions)

```
php src/bin/schemaFromObject.php -p "./properties" -o "./objects" -s "./t2"

```

```
php src/bin/o2s.php -p "./properties" -s "./schema" -o "./objects" -d "./schemadoc"

```

```
php src/bin/refsToURLs.php -s "./schema" -u "https://schmema.izzup.com" -o "./objects-izzup"

```

```
php src/bin/readPropertiesFromGoogle.php -s "1NeU79bJ-Zic-fwKK2PPuxntNXnbkyMKf6ZTIUHp1n4s" -c ~/.google/izzup-client_secret.json -p "./properties"

```

### Update schema

[](#update-schema)

```
php src/bin/convertSchemaRefs.php -s "./schema" -r "file://./" -o "./objects-local" -t "#/components/schema/"

```

```
php src/bin/convertSchemaRefs.php -s "./schema" -r "https://schema.izzup.com" -o "./objects-izzup" -t "#/components/schema/"

```

References
----------

[](#references)

JSON References ($ref):

JSON Schema:

Schemas:

Sponsored By:
-------------

[](#sponsored-by)

[UltriNet](http://www.ultri.net)

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4514677?v=4)[Brian Winkers](/maintainers/bwinkers)[@bwinkers](https://github.com/bwinkers)

### Embed Badge

![Health badge](/badges/activerules-nugget/health.svg)

```
[![Health](https://phpackages.com/badges/activerules-nugget/health.svg)](https://phpackages.com/packages/activerules-nugget)
```

###  Alternatives

[toplan/laravel-sms

A mobile phone number validation solution based on laravel

83580.2k2](/packages/toplan-laravel-sms)

PHPackages © 2026

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