ChangeLog.md
All notable changes are documented in this file using the Keep a CHANGELOG principles.
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 UnifiedDiffOutputBuilderSebastianBergmann\Diff\Chunk::getStart(), SebastianBergmann\Diff\Chunk::getStartRange(), SebastianBergmann\Diff\Chunk::getEnd(), SebastianBergmann\Diff\Chunk::getEndRange(), and SebastianBergmann\Diff\Chunk::getLines()SebastianBergmann\Diff\Diff::getFrom(), SebastianBergmann\Diff\Diff::getTo(), and SebastianBergmann\Diff\Diff::getChunks()SebastianBergmann\Diff\Line::getContent() and SebastianBergmann\Diff\Diff::getType()SebastianBergmann\Diff\Chunk::start(), SebastianBergmann\Diff\Chunk::startRange(), SebastianBergmann\Diff\Chunk::end(), SebastianBergmann\Diff\Chunk::endRange(), and SebastianBergmann\Diff\Chunk::lines()SebastianBergmann\Diff\Diff::from(), SebastianBergmann\Diff\Diff::to(), and SebastianBergmann\Diff\Diff::chunks()SebastianBergmann\Diff\Line::content() and SebastianBergmann\Diff\Diff::type()SebastianBergmann\Diff\Line::isAdded(),SebastianBergmann\Diff\Line::isRemoved(), and SebastianBergmann\Diff\Line::isUnchanged()SebastianBergmann\Diff\Diff now implements IteratorAggregate, iterating over it yields the aggregated SebastianBergmann\Diff\Chunk objectsSebastianBergmann\Diff\Chunk now implements IteratorAggregate, iterating over it yields the aggregated SebastianBergmann\Diff\Line objectsSebastianBergmann\Diff\Chunk::getStart(), SebastianBergmann\Diff\Chunk::getStartRange(), SebastianBergmann\Diff\Chunk::getEnd(), SebastianBergmann\Diff\Chunk::getEndRange(), and SebastianBergmann\Diff\Chunk::getLines()SebastianBergmann\Diff\Diff::getFrom(), SebastianBergmann\Diff\Diff::getTo(), and SebastianBergmann\Diff\Diff::getChunks()SebastianBergmann\Diff\Line::getContent() and SebastianBergmann\Diff\Diff::getType()TimeEfficientLongestCommonSubsequenceCalculatorMemoryEfficientLongestCommonSubsequenceCalculatorParser::parseFileDiff() does not handle diffs correctly that only add lines or only remove linesDiffOutputBuilderInterface instance to Differ::__construct() is no longer optionalSebastianBergmann\Diff\Exception now correctly extends \Throwablecomposer.json from ^7.3 || ^8.0 to >=7.3Chunk::setLines() now ensures that the $lines array only contains Line objects"minimum-stability": "dev", from composer.jsonStrictUnifiedDiffOutputBuilder implementation of the DiffOutputBuilderInterface was addedDiffOutputBuilderInterface implementation now generates context lines (unchanged lines)