__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace Jfcherng\Diff\Renderer\Html;
use Jfcherng\Diff\SequenceMatcher;
/**
* HTML Json diff generator.
*/
class JsonHtml extends AbstractHtml
{
/**
* {@inheritdoc}
*/
public const INFO = [
'desc' => 'HTML Json',
'type' => 'Html',
];
/**
* {@inheritdoc}
*/
public const IS_TEXT_RENDERER = true;
public function getResultForIdenticalsDefault(): string
{
return '[]';
}
protected function redererChanges(array $changes): string
{
if ($this->options['outputTagAsString']) {
$this->convertTagToString($changes);
}
return json_encode($changes, $this->options['jsonEncodeFlags']);
}
/**
* Convert tags of changes to their string form for better readability.
*
* @param array[][] $changes the changes
*/
protected function convertTagToString(array &$changes): void
{
foreach ($changes as &$hunks) {
foreach ($hunks as &$block) {
$block['tag'] = SequenceMatcher::opIntToStr($block['tag']);
}
}
}
protected function formatStringFromLines(string $string): string
{
return $this->htmlSafe($string);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| LineRenderer | Folder | 0775 |
|
|
| AbstractHtml.php | File | 11.19 KB | 0664 |
|
| Combined.php | File | 15.7 KB | 0664 |
|
| Inline.php | File | 7.12 KB | 0664 |
|
| Json.php | File | 209 B | 0664 |
|
| JsonHtml.php | File | 1.24 KB | 0664 |
|
| SideBySide.php | File | 7.36 KB | 0664 |
|