public function testDefaults() { $style = new Style(); $this->assertNull($style->getTag()); $this->assertNull($style->getForegroundColor()); $this->assertNull($style->getBackgroundColor()); $this->assertFalse($style->isBold()); $this->assertFalse($style->isUnderlined()); $this->assertFalse($style->isBlinking()); $this->assertFalse($style->isHidden()); $this->assertFalse($style->isInverse()); }
/** * Converts a {@link Style} instance to an {@link OutputFormatterStyle}. * * @param Style $style The style to convert. * * @return OutputFormatterStyle The converted style. */ public static function convert(Style $style) { $options = array(); if ($style->isBold()) { $options[] = 'bold'; } if ($style->isBlinking()) { $options[] = 'blink'; } if ($style->isUnderlined()) { $options[] = 'underscore'; } if ($style->isInverse()) { $options[] = 'reverse'; } if ($style->isHidden()) { $options[] = 'conceal'; } return new OutputFormatterStyle($style->getForegroundColor(), $style->getBackgroundColor(), $options); }