Skip to content

Commit

Permalink
use fullContextIfIdentical feature (thx @jfcherng)
Browse files Browse the repository at this point in the history
  • Loading branch information
deemru committed Mar 5, 2024
1 parent 760e0f6 commit db10caa
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,14 +905,9 @@ function htmlscript( $tx, $txkey, $txid, $compacted )
}

$result .= '<style>' . \Jfcherng\Diff\DiffHelper::getStyleSheet() . '</style>';
if( $decompile1 === $decompile2 )
{
$decompile1 = '# ' . $txid . "\n\n" . $decompile1;
$decompile2 = '# ' . $txidPrev . "\n\n" . $decompile2;
}
else
if( $decompile1 !== $decompile2 )
$result .= 'Diff: ' . PHP_EOL . \Jfcherng\Diff\DiffHelper::calculate( $decompile2, $decompile1, 'Inline', [], [ 'detailLevel' => 'word' ] ) . PHP_EOL;
$result .= 'Full: ' . PHP_EOL . \Jfcherng\Diff\DiffHelper::calculate( $decompile2, $decompile1, 'Inline', [ 'context' => \Jfcherng\Diff\Differ::CONTEXT_ALL ], [ 'detailLevel' => 'word' ] );
$result .= 'Full: ' . PHP_EOL . \Jfcherng\Diff\DiffHelper::calculate( $decompile2, $decompile1, 'Inline', [ 'context' => \Jfcherng\Diff\Differ::CONTEXT_ALL, 'fullContextIfIdentical' => true ], [ 'detailLevel' => 'word' ] );

return $result;
}
Expand Down

1 comment on commit db10caa

@deemru
Copy link
Owner Author

@deemru deemru commented on db10caa Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long awaited but never asked... but still implemented: jfcherng/php-diff#79

Please sign in to comment.