Skip to content

Commit

Permalink
Fix probably undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiLive authored and DigiLive committed Nov 19, 2020
1 parent 94c8bd5 commit 3954a2b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/jblond/Diff/Renderer/Text/InlineCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ private function mergeChanges(
foreach ($baselineParts as $partKey => &$part) {
if ($iterator++ % 2) {
// This part of the line has been changed. Surround it with user defined markers.
$basePart = $this->options['deleteMarkers'][0] . $part . $this->options['deleteMarkers'][1];
$basePart = $this->options['deleteMarkers'][0] . $part . $this->options['deleteMarkers'][1];
$changedPart = '';
if (isset($changedLineParts[$partKey])) {
$changedPart =
$this->options['insertMarkers'][0] .
Expand All @@ -219,13 +220,13 @@ private function mergeChanges(
}

if ($this->options['cliColor']) {
// Colorize the changed part.
[$fgColor, $bgColor] = $deleteColors;
$basePart = $colorize->getColoredString($basePart, $fgColor, $bgColor);
[$fgColor, $bgColor] = $insertColors;
$changedPart = $colorize->getColoredString($changedPart, $fgColor, $bgColor); // FIXME
// Colorize the changed part. $colorize is defined above.
$basePart = $colorize->getColoredString($basePart, ...$deleteColors);
if (!empty($changedPart)) {
$changedPart = $colorize->getColoredString($changedPart, ...$insertColors);
}
}
$part = $basePart . $changedPart; // FIXME
$part = $basePart . $changedPart;
}
}
unset($part);
Expand Down

0 comments on commit 3954a2b

Please sign in to comment.