Skip to content

Commit 274abbb

Browse files
committed
Shorten a couple lines
1 parent 346c0f7 commit 274abbb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Output/Color.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ public static function style(string $name, array $style): void
192192
throw new InvalidArgumentException('Trying to set empty or invalid style');
193193
}
194194

195-
if (method_exists(static::class, $name) && isset($style['bg']) && isset($style['fg']) && $style['bg'] === $style['fg']) {
196-
throw new InvalidArgumentException('Built-in styles cannot be invisible (matching background and foreground)');
195+
$invisible = (isset($style['bg']) && isset($style['fg']) && $style['bg'] === $style['fg']);
196+
if ($invisible && method_exists(static::class, $name)) {
197+
throw new InvalidArgumentException('Built-in styles cannot be invisible');
197198
}
198199

199200
static::$styles[$name] = $style;

0 commit comments

Comments
 (0)