masnathan/parser

Global data type parser

v0.0.1 2015-08-31 21:13 UTC

This package is not auto-updated.

Last update: 2020-04-03 17:28:00 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads Support via Gittip

Global data type parser

Install

Via Composer

$ composer require masnathan/parser

Usage

use MASNathan\Parser\Parser;

$data = array(
    'foo' => 'bar',
    'sup' => 'World'
);

$content = Parser::data($data);
$content->setPrettyOutput(true);

echo $content->to('json'); // outputs in json format
echo $content->to('xml'); // outputs in xml format

And also...

$content = Parser::file('path/to/my/file.json')->from('json');

echo $content->to('xml'); // outputs in xml format

// or
echo Parser::file('path/to/my/file.xml')
		->from('xml')
		->setPrettyOutput(true)
		->to('yaml');

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email andre.r.flip@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.