Skip to content

Commit

Permalink
Don't worry about missing styles if colors are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kodie committed Nov 28, 2024
1 parent c172fce commit e6097da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Output/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ public function __call(string $name, array $arguments): string
}

if (!method_exists($this, $name)) {
throw new InvalidArgumentException(sprintf('Style "%s" not defined', $name));
if (self::$colors_enabled) {
throw new InvalidArgumentException(sprintf('Style "%s" not defined', $name));
}

return $text;
}

return $this->{$name}($text, $style);
Expand Down

0 comments on commit e6097da

Please sign in to comment.