Merge pull request #84 from box/rename_strikethrough

Rename StrikeThrough to Strikethrough
This commit is contained in:
Adrien Loison 2015-08-13 23:18:26 -07:00
commit 444308d42c
5 changed files with 17 additions and 17 deletions

View File

@ -33,9 +33,9 @@ class Style
protected $hasSetFontUnderline = false;
/** @var bool Whether the font should be struck through */
protected $fontStrikeThrough = false;
protected $fontStrikethrough = false;
/** @var bool Whether the strikethrough property was set */
protected $hasSetFontStrikeThrough = false;
protected $hasSetFontStrikethrough = false;
/** @var int Font size */
protected $fontSize = self::DEFAULT_FONT_SIZE;
@ -133,18 +133,18 @@ class Style
/**
* @return boolean
*/
public function isFontStrikeThrough()
public function isFontStrikethrough()
{
return $this->fontStrikeThrough;
return $this->fontStrikethrough;
}
/**
* @return Style
*/
public function setFontStrikeThrough()
public function setFontStrikethrough()
{
$this->fontStrikeThrough = true;
$this->hasSetFontStrikeThrough = true;
$this->fontStrikethrough = true;
$this->hasSetFontStrikethrough = true;
$this->shouldApplyFont = true;
return $this;
}
@ -259,8 +259,8 @@ class Style
if (!$this->hasSetFontUnderline && $baseStyle->isFontUnderline()) {
$mergedStyle->setFontUnderline();
}
if (!$this->hasSetFontStrikeThrough && $baseStyle->isFontStrikeThrough()) {
$mergedStyle->setFontStrikeThrough();
if (!$this->hasSetFontStrikethrough && $baseStyle->isFontStrikethrough()) {
$mergedStyle->setFontStrikethrough();
}
if (!$this->hasSetFontSize && $baseStyle->getFontSize() !== self::DEFAULT_FONT_SIZE) {
$mergedStyle->setFontSize($baseStyle->getFontSize());

View File

@ -59,9 +59,9 @@ class StyleBuilder
*
* @return StyleBuilder
*/
public function setFontStrikeThrough()
public function setFontStrikethrough()
{
$this->style->setFontStrikeThrough();
$this->style->setFontStrikethrough();
return $this;
}

View File

@ -162,7 +162,7 @@ EOD;
if ($style->isFontUnderline()) {
$content .= ' <u/>' . PHP_EOL;
}
if ($style->isFontStrikeThrough()) {
if ($style->isFontStrikethrough()) {
$content .= ' <strike/>' . PHP_EOL;
}

View File

@ -71,14 +71,14 @@ class StyleTest extends \PHPUnit_Framework_TestCase
public function testMergeWithShouldPreferCurrentStylePropertyIfSetOnCurrentButNotOnBase()
{
$baseStyle = (new StyleBuilder())->build();
$currentStyle = (new StyleBuilder())->setFontItalic()->setFontStrikeThrough()->build();
$currentStyle = (new StyleBuilder())->setFontItalic()->setFontStrikethrough()->build();
$mergedStyle = $currentStyle->mergeWith($baseStyle);
$this->assertFalse($baseStyle->isFontItalic());
$this->assertFalse($baseStyle->isFontStrikeThrough());
$this->assertFalse($baseStyle->isFontStrikethrough());
$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())
->setFontItalic()
->setFontUnderline()
->setFontStrikeThrough()
->setFontStrikethrough()
->setShouldWrapText()
->build();
$currentStyle = (new StyleBuilder())->build();

View File

@ -106,7 +106,7 @@ class WriterWithStyleTest extends \PHPUnit_Framework_TestCase
->setFontBold()
->setFontItalic()
->setFontUnderline()
->setFontStrikeThrough()
->setFontStrikethrough()
->build();
$style2 = (new StyleBuilder())
->setFontSize(15)