Skip to content

Commit

Permalink
Update Diff.php for VersionStrategy::DIFF (#85)
Browse files Browse the repository at this point in the history
new and old both view sideBySide ->reverse()

foreach ($versionsBeforeThis->reverse() as $version) {
                if (! empty($version->contents)) {
                    $oldContents = array_merge($oldContents, $version->contents);
                }
            }
  • Loading branch information
SirajCse authored Oct 9, 2024
1 parent 8feeab5 commit 3fbdbdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function getContents(bool $stripTags = false): array
// all versions before this version.
$versionsBeforeThis = $this->newVersion->previousVersions()->get();

foreach ($versionsBeforeThis as $version) {
foreach ($versionsBeforeThis->reverse() as $version) { // DIFF show previous and current updated data
if (! empty($version->contents)) {
$oldContents = array_merge($oldContents, $version->contents);
}
Expand Down

0 comments on commit 3fbdbdd

Please sign in to comment.