faustbrian/jsonmapper-model-generator

Generates ready-to-use model classes for netresearch/jsonmapper

1.1.0 2017-01-20 12:21 UTC

README

Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require faustbrian/jsonmapper-model-generator

Usage

<?php

require_once 'vendor/autoload.php';

use BrianFaust\JsonMapper\Generator;

$model = new Generator('Vendor\Package', 'ClassName', [
    'userId' => 1,
    'id' => 1,
    'title' => 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit',
    'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt nemo earum, blanditiis harum aliquam minus id repellendus quia libero expedita itaque beatae et voluptate pariatur eos, voluptatem, saepe inventore tempora!',
    'created_at' => '2015-08-01 18:34:01',
]);

echo($model->output());

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@brianfaust.me. All security vulnerabilities will be promptly addressed.

Credits

License

MIT © Brian Faust