The package has no runtime dependencies and needs no framework or PHP extension beyond the PHP core.
Install the package with Composer.
composer require php-forge/diff:^0.1Every class lives in the PHPForge\Diff namespace and is loaded through the Composer autoloader. There is nothing to
register or configure: instantiate LineDiffer and call diff(), or UnifiedDiffRenderer and call render().
use PHPForge\Diff\{LineDiffer, UnifiedDiffRenderer};
$lines = (new LineDiffer())->diff("first\nsecond", "first\nthird");
$patch = (new UnifiedDiffRenderer())->render("first\nsecond\n", "first\nthird\n", 'a/notes.txt', 'b/notes.txt');