rustam/php-project-lvl2

v1.0 2020-06-22 17:24 UTC

This package is auto-updated.

Last update: 2025-04-16 00:22:29 UTC


README

Maintainability Test Coverage

Gendiff

This is a tutorial project that implements a file comparison utility.

To install via composer, enter in the console:

composer global require rustam/php-project-lvl2

Type for help.

gendiff -h
Generate diff

Usage: gendiff (-h|--help) gendiff (-v|--version) gendiff [--format <fmt>] <firstFile> <secondFile>

Options: -h --help Show this screen -v --version Show version --format <fmt> Report format [default: pretty]

Also this utility can be used as a function. Example:

genDiff('before.json', 'after.json', 'plain);

before.json after.json paths to files. format - output format.

You can use absolute and relative file paths to compare files

The utility is also capable of comparing files with a nested structure.

The utility is capable of displaying the result in three versions

-Plian -Pretty [default] -JSON

JSON:

Plain:

Supported file formats for comparison: .json .yaml .yml