sebastian/diff
sebastian/diff is a standalone PHP diff library, factored out of PHPUnit. It generates unified, strict unified, or diff-only output, parses unified diffs into object graphs, and supports custom output builders. Install via Composer as a project or development dependency.
UnifiedDiffOutputBuilder and AbstractChunkOutputBuilder classes have been removed, use StrictUnifiedDiffOutputBuilder insteadSebastianBergmann\Diff\LongestCommonSubsequenceCalculator interface, its two implementations SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator and SebastianBergmann\Diff\MemoryEfficientLongestCommonSubsequenceCalculator, and the $lcs parameter of SebastianBergmann\Diff\Differ::diff() and SebastianBergmann\Diff\Differ::diffToArray() have been removedUnifiedDiffOutputBuilder now accepts a fourth $emitNoLineEndEofWarning constructor parameter (default true) to suppress the \ No newline at end of file marker for use cases such as PHPUnit comparison failures that are not related to filesStrictUnifiedDiffOutputBuilder now accepts the options addLineNumbers, emitDiffLineEndWarning, emitNoLineEndEofWarning, and headerUnifiedDiffOutputBuilder now returns an empty string when no difference is detected (previously: returned the header)UnifiedDiffOutputBuilder::writeHunk() now writes the actual \ No newline at end of file marker text (previously: wrote only a line break) and silently skips diff entries with unknown typesSebastianBergmann\Diff\LongestCommonSubsequenceCalculator interface, its two implementations SebastianBergmann\Diff\TimeEfficientLongestCommonSubsequenceCalculator and SebastianBergmann\Diff\MemoryEfficientLongestCommonSubsequenceCalculator, and the $lcs parameter of SebastianBergmann\Diff\Differ::diff() and SebastianBergmann\Diff\Differ::diffToArray() are now deprecated; do not pass the $lcs parameter any more in preparation for the removal of these symbols and this parameter, respectivelyUnifiedDiffOutputBuilder behavior with StrictUnifiedDiffOutputBuilder$contextLines constructor parameter on UnifiedDiffOutputBuilderHow can I help you explore Laravel packages today?