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

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

otaavioo/json
=============

A light package for json encode/decode functions

2.1.0(2y ago)217.8k↓50%MITPHPPHP ^7.2

Since Aug 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/otaavioo/json)[ Packagist](https://packagist.org/packages/otaavioo/json)[ RSS](/packages/otaavioo-json/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

JSON
====

[](#json)

[![Build](https://github.com/otaavioo/json/actions/workflows/php.yml/badge.svg)](https://github.com/otaavioo/json/actions/workflows/php.yml)[![Coverage Status](https://camo.githubusercontent.com/1ddd470415b7429ca4257f6c1e6b399c7d519d3deca85ddc141a84b630a0565f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f74616176696f6f2f6a736f6e2f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/otaavioo/json?branch=main)

A light package for json encode/decode functions

Installing
----------

[](#installing)

```
composer require otaavioo/json ^2.0
```

### Encode

[](#encode)

```
    // Instantiate the class
    $json = new Json();

    $array = ['key' => 'value'];

    // And then, get encoded json
    echo $json->encode($array);
```

### Decode

[](#decode)

```
    // Instantiate the class
    $json = new Json();

    $string = '{"key":"value"}';

    // And then, get decoded json
    echo $json->decode($string);

    // And if you have a doubly encoded json, like this
    $string = '{\"key\":\"value\"}';

    // The decode method will return the same object as before
    echo $json->decode($string);
```

### Valid

[](#valid)

```
    // Instantiate the class
    $json = new Json();

    $string = '{"key":"value"}';

    // And then, check if is valid
    echo $json->isValid($string);
```

Developing
----------

[](#developing)

- To install dependencies, please, run `composer install`

### Testing

[](#testing)

- You can simply run `php vendor/bin/phpunit` to test using PHPUnit

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~559 days

Recently: every ~638 days

Total

6

Last Release

752d ago

Major Versions

1.1.1 → 2.0.02023-02-09

PHP version history (3 changes)1.0.0PHP &gt;=5.6.0

1.0.1PHP &gt;=5.5.9

2.0.0PHP ^7.2

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[collab/module-consent-mode

Cookie Consent Mode Popup Extension for Magento 2

121.8k](/packages/collab-module-consent-mode)

PHPackages © 2026

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