Skip to content

Commit e6097da

Browse files
committed
Don't worry about missing styles if colors are disabled
1 parent c172fce commit e6097da

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Output/Color.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ public function __call(string $name, array $arguments): string
235235
}
236236

237237
if (!method_exists($this, $name)) {
238-
throw new InvalidArgumentException(sprintf('Style "%s" not defined', $name));
238+
if (self::$colors_enabled) {
239+
throw new InvalidArgumentException(sprintf('Style "%s" not defined', $name));
240+
}
241+
242+
return $text;
239243
}
240244

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

0 commit comments

Comments
 (0)