PHPackages                             paulgessinger/json - 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. paulgessinger/json

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

paulgessinger/json
==================

wrapper for json\_encode and json\_decode with exceptions

0.1.0(12y ago)129PHPPHP &gt;=5.3.0

Since Mar 23Pushed 12y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

JSON
====

[](#json)

wrapper for json\_decode and json\_encode
-----------------------------------------

[](#wrapper-for-json_decode-and-json_encode)

[![Build Status](https://camo.githubusercontent.com/9c46cbb57b7fbe7f3b8b197e0959e1c9c3230d57da83275813392ee14bbfa102/68747470733a2f2f7472617669732d63692e6f72672f7061756c67657373696e6765722f4a534f4e2e737667)](https://travis-ci.org/paulgessinger/JSON)

Wraps the json functions in PHP in a static class, and throws specific exceptions

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

[](#installation)

via composer

1. Get [Composer](http://getcomposer.org/)
2. Add `"paulgessinger/json": "dev-master"` to your require
3. Install dependencies with `composer install`

Getting started
---------------

[](#getting-started)

The abstract class PG\\JSON contains three methods `JSON::decode`, `JSON::encode` and `JSON::beautify`. They throw error specific exceptions, which all inherit from PG\\JSON\\Exception\\JsonException, so you can catch them all at once. Just go

```
use PG\JSON ;
JSON::encode(array('abc' => 'def'));

// or

JSON::decode('{"abc":"def"}') ;
```

Tests
-----

[](#tests)

Run the tests by calling `phpunit` in the root dir of the repo PHPUnit is also included in the *require-dev*s so you can get it with `composer install --dev` or `composer update`.

Contributors
------------

[](#contributors)

- [Paul Gessinger](http://paulgessinger.com)

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2014 Paul Gessinger

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

4436d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/508b28973ba81277eb7713ff85fcbff3b2d53ddb1039c08f77e5a22080dd5b32?d=identicon)[paulgessinger](/maintainers/paulgessinger)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paulgessinger-json/health.svg)

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

###  Alternatives

[yii2mod/yii2-enum

Yii2 Enumerable helpers

63941.1k28](/packages/yii2mod-yii2-enum)[richardsjoqvist/silverstripe-embedder

Embedder enables embedding media in content fields area similar to how embeds work in WordPress

112.6k](/packages/richardsjoqvist-silverstripe-embedder)

PHPackages © 2026

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