PHP GenDiff
This is a program that determines the difference between two data structures.
Utility features:
- Support for different input formats: yaml and json
- Generating a report in plain text, stylish and json format
Requirements
- PHP >= 7.4
- funct library
- CLI parser (docopt)
Setup
$ git clone https://github.com/nikitovskij/php-gendiff.git
$ make install
Composer
$ composer require nikitovskij/php-gendiff
Testing
$ make test
Lint
$ make lint
Examples
php-gendiff: json
$ gendiff /path/to/file/first.json /path/to/file/second.json
Link to asciinema
php-gendiff: yml
$ gendiff /path/to/file/first.yml /path/to/file/second.yml
Link to asciinema
php-gendiff: pretty format output
The pretty
output format is set by default.
$ gendiff /path/to/file/first.json /path/to/file/second.json
or
$ gendiff --format pretty /path/to/file/first.json /path/to/file/second.json
Link to asciinema:asciinema
php-gendiff: plain format output
$ gendiff --format plain /path/to/file/first.json /path/to/file/second.json
Link to asciinema
php-gendiff: json format output
$ gendiff --format json /path/to/file/first.json /path/to/file/second.json
Link to asciinema