stanislavk / gendiff
Second project on Hexlet
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- docopt/docopt: ^1.0
- funct/funct: ^1.5
- symfony/yaml: ^5.2
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: 3.*
README
Command line app and PHP package installable with Composer to search for differences between two filesComposer
composer require stanislavk/gendiff
Uses
<?php
use function Differ\Differ\genDiff;
$diff = genDiff($pathToFile1, $pathToFile2, $format = 'stylish');
print_r($diff);
Formats
'stylish' (default), 'plain' and 'json'.
file1.json:
{
"host": "hexlet.io",
"timeout": 50,
"proxy": "123.234.53.22",
"follow": false
}
file2.json:
{
"timeout": 20,
"verbose": true,
"host": "hexlet.io"
}
Result
{
- follow: false
host: hexlet.io
- proxy: 123.234.53.22
- timeout: 50
+ timeout: 20
+ verbose: true
}