for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace OneSheet\Style;
use OneSheet\Xml\StyleXml;
/**
* Class Font
*
* @package OneSheet
*/
class Font implements Component
{
* @var int
private $id;
* @var string
private $italic;
private $underline;
private $bold;
private $strikethrough;
private $name = 'Calibri';
private $size = 11;
private $color = '000000';
* @param int $id
* @return Font
public function setId($id)
$this->id = $id;
return $this;
}
* @return int
public function getId()
return $this->id;
public function setItalic()
$this->italic = '<i/>';
public function setUnderline()
$this->underline = '<u/>';
* @return bool
public function isBold()
return null !== $this->bold;
public function setBold()
$this->bold = '<b/>';
public function setStrikethrough()
$this->strikethrough = '<s/>';
* @return string
public function getName()
return $this->name;
* @param string $name
public function setName($name)
$this->name = $name;
public function getSize()
return $this->size;
* @param int $size
public function setSize($size)
$this->size = $size;
* @param string $color
public function setColor($color)
$this->color = strtoupper($color);
public function asXml()
return sprintf(
StyleXml::FONT_DEFAULT_XML,
$this->size,
$this->color,
$this->name,
$this->bold,
$this->italic,
$this->underline,
$this->strikethrough
);