Skip to content

Commit

Permalink
Fix diffs when it's an array (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhamp authored Mar 28, 2024
1 parent 5de32f6 commit 57ea731
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public function getStatistics(array $differOptions = []): array
if ($newContents[$key] !== $oldContents[$key]) {
$diffStats->push(
(new Differ(
explode("\n", $newContents[$key]),
explode("\n", $oldContents[$key]),
explode("\n", is_string($newContents[$key]) ? $newContents[$key] : json_encode($newContents[$key])),
explode("\n", is_string($oldContents[$key]) ? $oldContents[$key] : json_encode($oldContents[$key])),
))->getStatistics()
);
}
Expand Down

0 comments on commit 57ea731

Please sign in to comment.