getTag() public method

Returns the style's tag name.
public getTag ( ) : string
return string The tag name or `null` if the style has no tag.
Esempio n. 1
0
 /**
  * Adds a style.
  *
  * @param Style $style The style to add.
  *
  * @throws LogicException If the tag of the style is not set.
  */
 public function add(Style $style)
 {
     if (!$style->getTag()) {
         throw new LogicException('The tag of a style added to the style set must be set.');
     }
     $this->styles[$style->getTag()] = $style;
 }
Esempio n. 2
0
 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());
 }