Last active
December 29, 2022 13:52
-
-
Save buismaarten/161be1b43601e0042a4e75ca1366a94a to your computer and use it in GitHub Desktop.
Revisions
-
buismaarten revised this gist
Dec 29, 2022 . No changes.There are no files selected for viewing
-
buismaarten revised this gist
Dec 29, 2022 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,10 @@ class MinimalDiffOutputBuilder implements DiffOutputBuilderInterface { /** * @param array $diff * @return string */ public function getDiff(array $diff): string { $result = ''; -
buismaarten revised this gist
Dec 29, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use SebastianBergmann\Diff\Differ; use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; class MinimalDiffOutputBuilder implements DiffOutputBuilderInterface { public function getDiff(array $diff): string { -
buismaarten revised this gist
Dec 29, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php use SebastianBergmann\Diff\Differ; use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; -
buismaarten created this gist
Dec 29, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ use SebastianBergmann\Diff\Differ; use SebastianBergmann\Diff\Output\DiffOutputBuilderInterface; final class MinimalDiffOutputBuilder implements DiffOutputBuilderInterface { public function getDiff(array $diff): string { $result = ''; foreach ($diff as $entry) { $flag = ''; if ($entry[1] === Differ::ADDED) { $flag = '+'; } if ($entry[1] === Differ::REMOVED) { $flag = '-'; } $result .= sprintf(" %-1s %s\n", $flag, rtrim($entry[0])); } return rtrim($result, "\n"); } }