PHP code example of symplify / markdown-diff

1. Go to this page and download the library: Download symplify/markdown-diff library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

symplify / markdown-diff example snippets


use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\MarkdownDiff\ValueObject\MarkdownDiffConfig;

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

namespace App;

use Symplify\MarkdownDiff\Differ\MarkdownDiffer;

final class SomeClass
{
    /**
     * @var MarkdownDiffer
     */
    private $markdownDiffer;

    public function __construct(MarkdownDiffer $markdownDiffer)
    {
        $this->markdownDiffer = $markdownDiffer;
    }

    public function run(): void
    {
        $markdownDiff = $this->markdownDiffer->diff('oldContent', 'newContent');
        // ...
    }
}