finagin/json

JSON class with throw exception

Maintainers

Details

github.com/finagin/json

Source

Issues

Installs: 13

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/finagin/json

1.0.3 2021-02-04 12:48 UTC

This package is auto-updated.

Last update: 2025-10-05 00:42:01 UTC


README

Latest Version on Packagist StyleCI Total Downloads
GitHub stars

Installation

This package can be used with PHP 7.3 or higher. You can install the package via composer:

composer require finagin/json

Usage

use Finagin\Json\Facades\Json;

try {
    // decode as object
    Json::decode($fromJson);
    Json::decodeAsObject($fromJson);
    
    // decode as array
    Json::decode($fromJson, 0, true);
    Json::decodeAsArray($fromJson);
    
    Json::encode($toJson, JSON_PRETTY_PRINT);
} catch (\JsonException $exception) {
    //
}

License

The MIT License (MIT). Please see License File for more information.