Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

[DEPRECATED] Use PackageBuilder instead

License

Notifications You must be signed in to change notification settings

deprecated-packages/console-color-diff

Repository files navigation

Console Color Diff

Downloads total

Install

composer require symplify/console-color-diff

Add to config/bundles.php:

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\ConsoleColorDiff\ValueObject\ConsoleColorDiffConfig;

return static function (ContainerConfigurator $containerConfigurator): void {
    $containerConfigurator->import(ConsoleColorDiffConfig::FILE_PATH);
};

Usage

namespace App;

use Symplify\ConsoleColorDiff\Console\Output\ConsoleDiffer;

class SomeCommand
{
    /**
     * @var ConsoleDiffer
     */
    private $consoleDiffer;

    public function __construct(ConsoleDiffer $consoleDiffer)
    {
        $this->consoleDiffer = $consoleDiffer;
    }

    public function run(): void
    {
        // prints colored diff to the console output
        $this->consoleDiffer->diff('oldContent', 'newContent');
    }
}

Report Issues

In case you are experiencing a bug or want to request a new feature head over to the Symplify monorepo issue tracker

Contribute

The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on symplify/symplify.