Download the PHP package nilportugues/json without Composer
On this page you can find all versions of the php package nilportugues/json. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nilportugues/json
More information about nilportugues/json
Files in nilportugues/json
Package json
Short Description JSON transformer outputting valid API responses.
License MIT
Homepage http://nilportugues.com
Informations about the package json
JSON Transformer
[] (https://travis-ci.org/nilportugues/php-json) [] (https://coveralls.io/github/nilportugues/json-transformer?branch=master) [] (https://scrutinizer-ci.com/g/nilportugues/json-transformer/?branch=master) [] (https://insight.sensiolabs.com/projects/76f021fa-6559-4faf-a010-5dfb95cd70e2) [] (https://packagist.org/packages/nilportugues/json) [] (https://packagist.org/packages/nilportugues/json) [] (https://packagist.org/packages/nilportugues/json)
Installation
Use Composer to install the package:
Usage
Given a PHP Object, and a series of mappings, the JSON Transformer will represent the given data as a JSON object.
For instance, given the following piece of code, defining a Blog Post and some comments:
And a Mapping array for all the involved classes:
Calling the transformer will output a valid JSON response using the correct formatting:
Output:
Quality
To run the PHPUnit tests at the command line, go to the tests directory and issue phpunit.
This library attempts to comply with PSR-1, PSR-2, PSR-4 and PSR-7.
If you notice compliance oversights, please send a patch via Pull Request.
Contribute
Contributions to the package are always welcome!
- Report any bugs or issues you find on the issue tracker.
- You can grab the source code at the package's Git repository.
Support
Get in touch with me using one of the following means:
- Emailing me at [email protected]
- Opening an Issue
- Using Gitter:
Authors
License
The code base is licensed under the MIT license.