Merge pull request #84 from box/rename_strikethrough
Rename StrikeThrough to Strikethrough
This commit is contained in:
commit
444308d42c
@ -33,9 +33,9 @@ class Style
|
|||||||
protected $hasSetFontUnderline = false;
|
protected $hasSetFontUnderline = false;
|
||||||
|
|
||||||
/** @var bool Whether the font should be struck through */
|
/** @var bool Whether the font should be struck through */
|
||||||
protected $fontStrikeThrough = false;
|
protected $fontStrikethrough = false;
|
||||||
/** @var bool Whether the strikethrough property was set */
|
/** @var bool Whether the strikethrough property was set */
|
||||||
protected $hasSetFontStrikeThrough = false;
|
protected $hasSetFontStrikethrough = false;
|
||||||
|
|
||||||
/** @var int Font size */
|
/** @var int Font size */
|
||||||
protected $fontSize = self::DEFAULT_FONT_SIZE;
|
protected $fontSize = self::DEFAULT_FONT_SIZE;
|
||||||
@ -133,18 +133,18 @@ class Style
|
|||||||
/**
|
/**
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isFontStrikeThrough()
|
public function isFontStrikethrough()
|
||||||
{
|
{
|
||||||
return $this->fontStrikeThrough;
|
return $this->fontStrikethrough;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Style
|
* @return Style
|
||||||
*/
|
*/
|
||||||
public function setFontStrikeThrough()
|
public function setFontStrikethrough()
|
||||||
{
|
{
|
||||||
$this->fontStrikeThrough = true;
|
$this->fontStrikethrough = true;
|
||||||
$this->hasSetFontStrikeThrough = true;
|
$this->hasSetFontStrikethrough = true;
|
||||||
$this->shouldApplyFont = true;
|
$this->shouldApplyFont = true;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -259,8 +259,8 @@ class Style
|
|||||||
if (!$this->hasSetFontUnderline && $baseStyle->isFontUnderline()) {
|
if (!$this->hasSetFontUnderline && $baseStyle->isFontUnderline()) {
|
||||||
$mergedStyle->setFontUnderline();
|
$mergedStyle->setFontUnderline();
|
||||||
}
|
}
|
||||||
if (!$this->hasSetFontStrikeThrough && $baseStyle->isFontStrikeThrough()) {
|
if (!$this->hasSetFontStrikethrough && $baseStyle->isFontStrikethrough()) {
|
||||||
$mergedStyle->setFontStrikeThrough();
|
$mergedStyle->setFontStrikethrough();
|
||||||
}
|
}
|
||||||
if (!$this->hasSetFontSize && $baseStyle->getFontSize() !== self::DEFAULT_FONT_SIZE) {
|
if (!$this->hasSetFontSize && $baseStyle->getFontSize() !== self::DEFAULT_FONT_SIZE) {
|
||||||
$mergedStyle->setFontSize($baseStyle->getFontSize());
|
$mergedStyle->setFontSize($baseStyle->getFontSize());
|
||||||
|
@ -59,9 +59,9 @@ class StyleBuilder
|
|||||||
*
|
*
|
||||||
* @return StyleBuilder
|
* @return StyleBuilder
|
||||||
*/
|
*/
|
||||||
public function setFontStrikeThrough()
|
public function setFontStrikethrough()
|
||||||
{
|
{
|
||||||
$this->style->setFontStrikeThrough();
|
$this->style->setFontStrikethrough();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ EOD;
|
|||||||
if ($style->isFontUnderline()) {
|
if ($style->isFontUnderline()) {
|
||||||
$content .= ' <u/>' . PHP_EOL;
|
$content .= ' <u/>' . PHP_EOL;
|
||||||
}
|
}
|
||||||
if ($style->isFontStrikeThrough()) {
|
if ($style->isFontStrikethrough()) {
|
||||||
$content .= ' <strike/>' . PHP_EOL;
|
$content .= ' <strike/>' . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,14 +71,14 @@ class StyleTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testMergeWithShouldPreferCurrentStylePropertyIfSetOnCurrentButNotOnBase()
|
public function testMergeWithShouldPreferCurrentStylePropertyIfSetOnCurrentButNotOnBase()
|
||||||
{
|
{
|
||||||
$baseStyle = (new StyleBuilder())->build();
|
$baseStyle = (new StyleBuilder())->build();
|
||||||
$currentStyle = (new StyleBuilder())->setFontItalic()->setFontStrikeThrough()->build();
|
$currentStyle = (new StyleBuilder())->setFontItalic()->setFontStrikethrough()->build();
|
||||||
$mergedStyle = $currentStyle->mergeWith($baseStyle);
|
$mergedStyle = $currentStyle->mergeWith($baseStyle);
|
||||||
|
|
||||||
$this->assertFalse($baseStyle->isFontItalic());
|
$this->assertFalse($baseStyle->isFontItalic());
|
||||||
$this->assertFalse($baseStyle->isFontStrikeThrough());
|
$this->assertFalse($baseStyle->isFontStrikethrough());
|
||||||
|
|
||||||
$this->assertTrue($mergedStyle->isFontItalic());
|
$this->assertTrue($mergedStyle->isFontItalic());
|
||||||
$this->assertTrue($mergedStyle->isFontStrikeThrough());
|
$this->assertTrue($mergedStyle->isFontStrikethrough());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -89,7 +89,7 @@ class StyleTest extends \PHPUnit_Framework_TestCase
|
|||||||
$baseStyle = (new StyleBuilder())
|
$baseStyle = (new StyleBuilder())
|
||||||
->setFontItalic()
|
->setFontItalic()
|
||||||
->setFontUnderline()
|
->setFontUnderline()
|
||||||
->setFontStrikeThrough()
|
->setFontStrikethrough()
|
||||||
->setShouldWrapText()
|
->setShouldWrapText()
|
||||||
->build();
|
->build();
|
||||||
$currentStyle = (new StyleBuilder())->build();
|
$currentStyle = (new StyleBuilder())->build();
|
||||||
|
@ -106,7 +106,7 @@ class WriterWithStyleTest extends \PHPUnit_Framework_TestCase
|
|||||||
->setFontBold()
|
->setFontBold()
|
||||||
->setFontItalic()
|
->setFontItalic()
|
||||||
->setFontUnderline()
|
->setFontUnderline()
|
||||||
->setFontStrikeThrough()
|
->setFontStrikethrough()
|
||||||
->build();
|
->build();
|
||||||
$style2 = (new StyleBuilder())
|
$style2 = (new StyleBuilder())
|
||||||
->setFontSize(15)
|
->setFontSize(15)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user