2017 © Pedro Peláez
 

library tjson-parser

A PHP parser for TJSON format

image

qligier/tjson-parser

A PHP parser for TJSON format

  • Wednesday, October 25, 2017
  • by qligier
  • Repository
  • 2 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

TJSON Parser

A TJSON parser written in PHP, using Phlexy as JSON lexer., (*1)

StyleCI Shield , (*2)

Requirements

  • PHP 7.0 at minimum is needed;
  • The GMP extension.

Quick start

Installation

Install the library with composer:, (*3)

composer require qligier/tjson-parser, (*4)

Usage

$parser = new Kentin\TJSON\Parser;
$tjson = '{"message:u":"Hello World!"}';

var_dump($parser->parse($tjson));
/*
array(1) {
  'message' =>
  string(12) "Hello World!"
}
*/

Data mapping

  • Boolean values are returned as boolean;
  • Binary values are decoded and returned as string;
  • FloatingPoint values are returned as float;
  • Integer values are returned as GMP instance;
  • UnicodeString values are returned as string;
  • Timestamp values are returned as DateTime instance;
  • Array values are returned as indexed array;
  • Object values are returned as associative array;
  • Set values are returned as indexed array.

Compliance

This library tries to be fully compliant with the current draft-tjson-spec (April 15, 2017). Nonetheless, the following non-compliances are not excluded:, (*5)

  • The library accepts various formatting for FloatingPoint and Integer values that could be forbidden by the spec.

Development

To check the library with Psalm (a static analysis tool for finding errors):, (*6)

./vendor/bin/psalm

To execute the unit tests with PHPUnit (an unit testing framework):, (*7)

./vendor/bin/phpunit

To check the library with Infection (a mutation testing framework):, (*8)

./vendor/bin/infection --min-msi=100 --min-covered-msi=100

To check and fix the coding style with PHP Coding Standards Fixer (a tool to automatically fix PHP coding standards issues):, (*9)

./vendor/bin/php-cs-fixer fix . --dry-run --diff
./vendor/bin/php-cs-fixer fix .

The Versions

25/10 2017

dev-master

9999999-dev

A PHP parser for TJSON format

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

25/10 2017

0.1.1

0.1.1.0

A PHP parser for TJSON format

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

25/10 2017

0.1.0

0.1.0.0

A PHP parser for TJSON format

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires