Skip to content

Commit 98781fd

Browse files
committed
check only if option is set
1 parent fbccaf4 commit 98781fd

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/jblond/Diff/Renderer/Text/UnifiedCli.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ public function render(): string
4949
if (!isset($this->options['cliColor'])) {
5050
return $this->output();
5151
}
52-
if (isset($this->options['cliColor']) && $this->options['cliColor'] === true) {
53-
return $this->output();
54-
}
55-
throw new InvalidArgumentException('Invalid cliColor option');
52+
return $this->output();
5653
}
5754

5855

@@ -63,7 +60,7 @@ public function render(): string
6360
*/
6461
private function colorizeString($string, $color = ''): string
6562
{
66-
if (isset($this->options['cliColor']) && $this->options['cliColor'] === true) {
63+
if (isset($this->options['cliColor'])) {
6764
return $this->colors->getColoredString($string, $color);
6865
}
6966
return $string;

0 commit comments

Comments
 (0)