2017 © Pedro PelĂĄez
 

library json-printer

Provides a JSON printer, allowing for flexible indentation.

image

localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  • Sunday, June 3, 2018
  • by localheinz
  • Repository
  • 1 Watchers
  • 5 Stars
  • 11,940 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 10 Versions
  • 58 % Grown

The README.md

json-printer

Integrate Merge Release Renew, (*1)

Code Coverage Type Coverage, (*2)

Latest Stable Version Total Downloads Monthly Downloads, (*3)

This project provides a composer package with a JSON printer, allowing for flexible indentation., (*4)

Installation

Run, (*5)

composer require ergebnis/json-printer

Usage

Let's assume we have a variable $json which contains some JSON that is not indented:, (*6)

{"name":"Andreas Möller","emoji":"đŸ€“","urls":["https://localheinz.com","https://github.com/localheinz","https://twitter.com/localheinz"]}

or indented with 4 spaces:, (*7)

{
    "name":"Andreas Möller",
    "emoji":"đŸ€“",
    "urls":[
        "https://localheinz.com",
        "https://github.com/localheinz",
        "https://twitter.com/localheinz"
    ]
}

but we want to indent it with 2 spaces (or tabs)., (*8)

This is where Ergebnis\Json\Printer\Printer comes in, (*9)

<?php

declare(strict_types=1);

use Ergebnis\Json\Printer;

$printer = new Printer\Printer();

$printed = $printer->print(
    $json,
    '  ',
);

which results in $printed:, (*10)

{
  "name":"Andreas Möller",
  "emoji":"đŸ€“",
  "urls":[
    "https://localheinz.com",
    "https://github.com/localheinz",
    "https://twitter.com/localheinz"
  ]
}

:bulb: Note that this printer is only concerned with normalizing the indentation, no escaping or un-escaping occurs., (*11)

Changelog

The maintainers of this project record notable changes to this project in a changelog., (*12)

Contributing

The maintainers of this project suggest following the contribution guide., (*13)

Code of Conduct

The maintainers of this project ask contributors to follow the code of conduct., (*14)

General Support Policy

The maintainers of this project provide limited support., (*15)

You can support the maintenance of this project by sponsoring @localheinz or requesting an invoice for services related to this project., (*16)

PHP Version Support Policy

This project supports PHP versions with active and security support., (*17)

The maintainers of this project add support for a PHP version following its initial release and drop support for a PHP version when it has reached the end of security support., (*18)

Security Policy

This project has a security policy., (*19)

License

This project uses the MIT license., (*20)

Credits

The Printer is adopted from Composer\Json\JsonFormatter (originally licensed under MIT by Nils Adermann and Jordi Boggiano), who adopted it from a blog post by Dave Perrett (originally licensed under MIT by Dave Perrett)., (*21)

The PrinterTest is inspired by Composer\Test\Json\JsonFormatterTest (originally licensed under MIT by Nils Adermann and Jordi Boggiano), as well as ZendTest\Json\JsonTest (originally licensed under New BSD License)., (*22)

Social

Follow @localheinz and @ergebnis on Twitter., (*23)

The Versions

03/06 2018

dev-master

9999999-dev https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

07/04 2018

2.0.0

2.0.0.0 https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

06/04 2018

dev-feature/new-line

dev-feature/new-line https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

06/04 2018

dev-fix/phpunit

dev-fix/phpunit https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

06/04 2018

dev-feature/php-cs-fixer-config

dev-feature/php-cs-fixer-config https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

06/04 2018

dev-feature/infection

dev-feature/infection https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

27/01 2018

1.1.0

1.1.0.0 https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

27/01 2018

dev-fix/docblock

dev-fix/docblock https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

27/01 2018

dev-feature/urls

dev-feature/urls https://github.com/localheinz/json-printer

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer

05/01 2018

1.0.0

1.0.0.0

Provides a JSON printer, allowing for flexible indentation.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

json formatter printer