Rename StrikeThrough to Strikethrough

This commit is contained in:
Adrien Loison 2015-08-13 23:09:43 -07:00
parent 4a346cef0c
commit f043f8d4d0
5 changed files with 17 additions and 17 deletions

View File

@ -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());

View File

@ -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;
} }

View File

@ -117,7 +117,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;
} }

View File

@ -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();

View File

@ -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)