Skip to content

Commit d7dd0ec

Browse files
committed
Short-circut the missing method the same way we do line function
1 parent e6097da commit d7dd0ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Output/Color.php

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

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

242-
return $text;
242+
throw new InvalidArgumentException(sprintf('Style "%s" not defined', $name));
243243
}
244244

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

0 commit comments

Comments
 (0)