Download the PHP package nilportugues/jsend without Composer
On this page you can find all versions of the php package nilportugues/jsend. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nilportugues/jsend
More information about nilportugues/jsend
Files in nilportugues/jsend
Package jsend
Short Description JSend API transformer outputting valid API responses.
License MIT
Homepage http://nilportugues.com
Informations about the package jsend
JSend API Transformer
[] (https://insight.sensiolabs.com/projects/2ee8556c-d480-4f6f-a645-0ee18c271867) [] (https://packagist.org/packages/nilportugues/jsend) [] (https://packagist.org/packages/nilportugues/jsend)
Installation
Use Composer to install the package:
Usage
Given a PHP Object, and a series of mappings, the JSend 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.