More refactoring for PHPMD compliance

This commit is contained in:
Ivan Lanin 2014-05-04 15:13:31 +07:00
parent f6f52afa68
commit c21e28f974
37 changed files with 492 additions and 548 deletions

View File

@ -38,12 +38,11 @@ before_script:
script:
## PHP_CodeSniffer
- phpcs --standard=PSR2 -n src/ --ignore=src/PhpWord/Shared/PCLZip
- phpcs --standard=PSR2 -n tests/
- phpcs src/ tests/ --standard=PSR2 -n --ignore=src/PhpWord/Shared/PCLZip
## PHP Copy/Paste Detector
- php phpcpd.phar --verbose src/
- phpcpd src/ tests/ --verbose
## PHP Mess Detector
- phpmd src/ text phpmd.xml --exclude pclzip.lib.php
- phpmd src/ text unusedcode,naming,design,controversial --exclude pclzip.lib.php
## PHPLOC
#- php phploc.phar src/
## PHPUnit

View File

@ -90,6 +90,7 @@ This release marked heavy refactorings on internal code structure with the creat
- Refactor: Apply composite pattern for Word2007 reader - @ivanlanin
- Refactor: Replace static classes `Footnotes`, `Endnotes`, and `TOC` with `Collections` - @ivanlanin GH-206
- QA: Reactivate `phpcpd` and `phpmd` on Travis - @ivanlanin
- Refactor: PHPMD recommendation: Change all `get...` method that returns `boolean` into `is...` or `has...` - @ivanlanin
## 0.9.1 - 27 Mar 2014

View File

@ -1,14 +0,0 @@
<?xml version="1.0"?>
<ruleset name="PHPWord mess detector ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd">
<rule ref="rulesets/unusedcode.xml" />
<rule ref="rulesets/design.xml" />
<rule ref="rulesets/naming.xml/LongVariable" />
<rule ref="rulesets/naming.xml/ShortVariable" />
<rule ref="rulesets/naming.xml/ShortMethodName" />
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />
<rule ref="rulesets/naming.xml/ConstantNamingConventions" />
</ruleset>

View File

@ -9,17 +9,15 @@
namespace PhpOffice\PhpWord\Element;
use PhpOffice\PhpWord\PhpWord;
use PhpOffice\PhpWord\Media;
use PhpOffice\PhpWord\Element\CheckBox;
use PhpOffice\PhpWord\Element\Image;
use PhpOffice\PhpWord\Element\Link;
use PhpOffice\PhpWord\Element\ListItem;
use PhpOffice\PhpWord\Element\Object;
use PhpOffice\PhpWord\Element\PreserveText;
use PhpOffice\PhpWord\Element\Text;
use PhpOffice\PhpWord\Element\TextBreak;
use PhpOffice\PhpWord\Element\TextRun;
use PhpOffice\PhpWord\Exception\InvalidObjectException;
/**
* Container abstract class
@ -69,27 +67,29 @@ abstract class AbstractContainer extends AbstractElement
}
/**
* Add text element
* Add text/preservetext element
*
* @param string $text
* @param mixed $fontStyle
* @param mixed $paragraphStyle
* @return \PhpOffice\PhpWord\Element\Text
* @param string $elementName Text|PreserveText
* @return \PhpOffice\PhpWord\Element\Text|\PhpOffice\PhpWord\Element\PreserveText
*/
public function addText($text, $fontStyle = null, $paragraphStyle = null)
public function addText($text, $fontStyle = null, $paragraphStyle = null, $elementName = 'Text')
{
$this->checkValidity('Text');
$this->checkValidity($elementName);
$elementClass = 'PhpOffice\\PhpWord\\Element\\' . $elementName;
// Reset paragraph style for footnote and textrun. They have their own
if (in_array($this->container, array('textrun', 'footnote', 'endnote'))) {
$paragraphStyle = null;
}
$textObject = new Text($text, $fontStyle, $paragraphStyle);
$textObject->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($textObject);
$element = new $elementClass($text, $fontStyle, $paragraphStyle);
$element->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($element);
return $textObject;
return $element;
}
/**
@ -102,11 +102,11 @@ abstract class AbstractContainer extends AbstractElement
{
$this->checkValidity('Textrun');
$textRun = new TextRun($paragraphStyle);
$textRun->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($textRun);
$element = new TextRun($paragraphStyle);
$element->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($element);
return $textRun;
return $element;
}
/**
@ -123,13 +123,15 @@ abstract class AbstractContainer extends AbstractElement
$this->checkValidity('Link');
$elementDocPart = $this->checkElementDocPart();
$link = new Link($target, $text, $fontStyle, $paragraphStyle);
$link->setDocPart($this->getDocPart(), $this->getDocPartId());
$rId = Media::addElement($elementDocPart, 'link', $target);
$link->setRelationId($rId);
$this->addElement($link);
$element = new Link($target, $text, $fontStyle, $paragraphStyle);
$element->setDocPart($this->getDocPart(), $this->getDocPartId());
return $link;
$rId = Media::addElement($elementDocPart, 'link', $target);
$element->setRelationId($rId);
$this->addElement($element);
return $element;
}
/**
@ -142,13 +144,7 @@ abstract class AbstractContainer extends AbstractElement
*/
public function addPreserveText($text, $fontStyle = null, $paragraphStyle = null)
{
$this->checkValidity('PreserveText');
$preserveText = new PreserveText($text, $fontStyle, $paragraphStyle);
$preserveText->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($preserveText);
return $preserveText;
return $this->addText($text, $fontStyle, $paragraphStyle, 'PreserveText');
}
/**
@ -163,9 +159,9 @@ abstract class AbstractContainer extends AbstractElement
$this->checkValidity('TextBreak');
for ($i = 1; $i <= $count; $i++) {
$textBreak = new TextBreak($fontStyle, $paragraphStyle);
$textBreak->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($textBreak);
$element = new TextBreak($fontStyle, $paragraphStyle);
$element->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($element);
}
}
@ -183,33 +179,35 @@ abstract class AbstractContainer extends AbstractElement
{
$this->checkValidity('ListItem');
$listItem = new ListItem($text, $depth, $fontStyle, $listStyle, $paragraphStyle);
$listItem->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($listItem);
$element = new ListItem($text, $depth, $fontStyle, $listStyle, $paragraphStyle);
$element->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($element);
return $listItem;
return $element;
}
/**
* Add image element
*
* @param string $src
* @param string $source
* @param mixed $style Image style
* @param boolean $isWatermark
* @return \PhpOffice\PhpWord\Element\Image
*/
public function addImage($src, $style = null, $isWatermark = false)
public function addImage($source, $style = null, $isWatermark = false)
{
$this->checkValidity('Image');
$elementDocPart = $this->checkElementDocPart();
$image = new Image($src, $style, $isWatermark);
$image->setDocPart($this->getDocPart(), $this->getDocPartId());
$rId = Media::addElement($elementDocPart, 'image', $src, $image);
$image->setRelationId($rId);
$this->addElement($image);
$element = new Image($source, $style, $isWatermark);
$element->setDocPart($this->getDocPart(), $this->getDocPartId());
return $image;
$rId = Media::addElement($elementDocPart, 'image', $source, $element);
$element->setRelationId($rId);
$this->addElement($element);
return $element;
}
/**
@ -217,35 +215,27 @@ abstract class AbstractContainer extends AbstractElement
*
* All exceptions should be handled by \PhpOffice\PhpWord\Element\Object
*
* @param string $src
* @param string $source
* @param mixed $style
* @return \PhpOffice\PhpWord\Element\Object
* @throws \PhpOffice\PhpWord\Exception\Exception
*/
public function addObject($src, $style = null)
public function addObject($source, $style = null)
{
$this->checkValidity('Object');
$elementDocPart = $this->checkElementDocPart();
$object = new Object($src, $style);
$object->setDocPart($this->getDocPart(), $this->getDocPartId());
if (!is_null($object->getSource())) {
$inf = pathinfo($src);
$ext = $inf['extension'];
if (strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') {
$ext = substr($ext, 0, -1);
}
$icon = realpath(__DIR__ . "/../resources/{$ext}.png");
$rId = Media::addElement($elementDocPart, 'object', $src);
$object->setRelationId($rId);
$rIdimg = Media::addElement($elementDocPart, 'image', $icon, new Image($icon));
$object->setImageRelationId($rIdimg);
$this->addElement($object);
$element = new Object($source, $style);
$element->setDocPart($this->getDocPart(), $this->getDocPartId());
return $object;
} else {
throw new InvalidObjectException();
}
$rId = Media::addElement($elementDocPart, 'object', $source);
$element->setRelationId($rId);
$rIdIcon = Media::addElement($elementDocPart, 'image', $element->getIcon(), new Image($element->getIcon()));
$element->setImageRelationId($rIdIcon);
$this->addElement($element);
return $element;
}
/**
@ -258,19 +248,19 @@ abstract class AbstractContainer extends AbstractElement
public function addFootnote($paragraphStyle = null, $elementName = 'Footnote')
{
$this->checkValidity($elementName);
$elementClass = 'PhpOffice\\PhpWord\\Element\\' . $elementName;
$docPart = strtolower($elementName);
$addMethod = "add{$elementName}";
$elementClass = 'PhpOffice\\PhpWord\\Element\\' . $elementName;
$note = new $elementClass($paragraphStyle);
// if ($this->phpWord instanceof PhpWord) {
$rId = $this->phpWord->$addMethod($note);
// }
$note->setDocPart($docPart, $this->getDocPartId());
$note->setRelationId($rId);
$this->addElement($note);
$element = new $elementClass($paragraphStyle);
if ($this->phpWord instanceof PhpWord) {
$rId = $this->phpWord->$addMethod($element);
}
$element->setDocPart($docPart, $this->getDocPartId());
$element->setRelationId($rId);
$this->addElement($element);
return $note;
return $element;
}
/**
@ -297,11 +287,11 @@ abstract class AbstractContainer extends AbstractElement
{
$this->checkValidity('CheckBox');
$checkBox = new CheckBox($name, $text, $fontStyle, $paragraphStyle);
$checkBox->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($checkBox);
$element = new CheckBox($name, $text, $fontStyle, $paragraphStyle);
$element->setDocPart($this->getDocPart(), $this->getDocPartId());
$this->addElement($element);
return $checkBox;
return $element;
}
/**

View File

@ -92,13 +92,13 @@ abstract class AbstractElement
}
/**
* Set PhpWord
* Set PhpWord as reference
*
* @param \PhpOffice\PhpWord\PhpWord
*/
public function setPhpWord(PhpWord &$phpWord = null)
{
$this->phpWord = $phpWord;
$this->phpWord = &$phpWord;
}
/**

View File

@ -44,7 +44,7 @@ class Footer extends AbstractContainer
* Create new instance
*
* @param int $sectionId
* @param int $footerId
* @param int $containerId
* @param string $type
*/
public function __construct($sectionId, $containerId = 1, $type = self::AUTO)

View File

@ -52,7 +52,7 @@ class Image extends AbstractElement
*
* @var boolean
*/
private $isWatermark;
private $watermark;
/**
* Image type
@ -87,7 +87,7 @@ class Image extends AbstractElement
*
* @var boolean
*/
private $isMemImage;
private $memoryImage;
/**
* Image target file name
@ -108,14 +108,14 @@ class Image extends AbstractElement
*
* @param string $source
* @param mixed $style
* @param boolean $isWatermark
* @param boolean $watermark
* @throws \PhpOffice\PhpWord\Exception\InvalidImageException
* @throws \PhpOffice\PhpWord\Exception\UnsupportedImageTypeException
*/
public function __construct($source, $style = null, $isWatermark = false)
public function __construct($source, $style = null, $watermark = false)
{
$this->source = $source;
$this->setIsWatermark($isWatermark);
$this->setIsWatermark($watermark);
$this->style = $this->setStyle(new ImageStyle(), $style, true);
$this->checkImage($source);
@ -166,19 +166,19 @@ class Image extends AbstractElement
*
* @return boolean
*/
public function getIsWatermark()
public function isWatermark()
{
return $this->isWatermark;
return $this->watermark;
}
/**
* Set is watermark
*
* @param boolean $pValue
* @param boolean $value
*/
public function setIsWatermark($pValue)
public function setIsWatermark($value)
{
$this->isWatermark = $pValue;
$this->watermark = $value;
}
/**
@ -226,9 +226,9 @@ class Image extends AbstractElement
*
* @return boolean
*/
public function getIsMemImage()
public function isMemImage()
{
return $this->isMemImage;
return $this->memoryImage;
}
/**
@ -314,14 +314,14 @@ class Image extends AbstractElement
private function setSourceType($source)
{
if (stripos(strrev($source), strrev('.php')) === 0) {
$this->isMemImage = true;
$this->memoryImage = true;
$this->sourceType = self::SOURCE_GD;
} elseif (strpos($source, 'zip://') !== false) {
$this->isMemImage = false;
$this->memoryImage = false;
$this->sourceType = self::SOURCE_ARCHIVE;
} else {
$this->isMemImage = (filter_var($source, FILTER_VALIDATE_URL) !== false);
$this->sourceType = $this->isMemImage ? self::SOURCE_GD : self::SOURCE_LOCAL;
$this->memoryImage = (filter_var($source, FILTER_VALIDATE_URL) !== false);
$this->sourceType = $this->memoryImage ? self::SOURCE_GD : self::SOURCE_LOCAL;
}
}
@ -409,4 +409,26 @@ class Image extends AbstractElement
}
}
}
/**
* Get is watermark
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getIsWatermark()
{
return $this->isWatermark();
}
/**
* Get is memory image
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getIsMemImage()
{
return $this->isMemImage();
}
}

View File

@ -10,6 +10,7 @@
namespace PhpOffice\PhpWord\Element;
use PhpOffice\PhpWord\Style\Image as ImageStyle;
use PhpOffice\PhpWord\Exception\InvalidObjectException;
/**
* Object element
@ -30,6 +31,13 @@ class Object extends AbstractElement
*/
private $style;
/**
* Icon
*
* @var string
*/
private $icon;
/**
* Image Relation ID
*
@ -40,35 +48,32 @@ class Object extends AbstractElement
/**
* Create a new Ole-Object Element
*
* @param string $src
* @param string $source
* @param mixed $style
*/
public function __construct($src, $style = null)
public function __construct($source, $style = null)
{
$supportedTypes = array('xls', 'doc', 'ppt', 'xlsx', 'docx', 'pptx');
$inf = pathinfo($src);
$pathInfo = pathinfo($source);
if (file_exists($src) && in_array($inf['extension'], $supportedTypes)) {
$this->source = $src;
if (file_exists($source) && in_array($pathInfo['extension'], $supportedTypes)) {
$ext = $pathInfo['extension'];
if (strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') {
$ext = substr($ext, 0, -1);
}
$this->source = $source;
$this->style = $this->setStyle(new ImageStyle(), $style, true);
$this->icon = realpath(__DIR__ . "/../resources/{$ext}.png");
return $this;
} else {
return false;
throw new InvalidObjectException();
}
}
/**
* Get Image style
*
* @return \PhpOffice\PhpWord\Style\Image
*/
public function getStyle()
{
return $this->style;
}
/**
* Get Source
* Get object source
*
* @return string
*/
@ -78,7 +83,27 @@ class Object extends AbstractElement
}
/**
* Get Image Relation ID
* Get object style
*
* @return \PhpOffice\PhpWord\Style\Image
*/
public function getStyle()
{
return $this->style;
}
/**
* Get object icon
*
* @return string
*/
public function getIcon()
{
return $this->icon;
}
/**
* Get image relation ID
*
* @return int
*/

View File

@ -29,14 +29,7 @@ class Title extends AbstractElement
*
* @var int
*/
private $depth;
/**
* Title anchor
*
* @var int
*/
private $anchor;
private $depth = 1;
/**
* Title Bookmark ID
@ -52,13 +45,19 @@ class Title extends AbstractElement
*/
private $style;
/**
* Title anchor
*
* @var int
* @deprecated 0.10.0
*/
private $anchor;
/**
* Create a new Title Element
*
* @param string $text
* @param int $depth
* @param string $style
*/
public function __construct($text, $depth = 1)
{

View File

@ -1,151 +0,0 @@
<?php
/**
* PHPWord
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
namespace PhpOffice\PhpWord;
/**
* Footnote collection
*
* This static class has been deprecated and replaced by Collection\Footnotes.
* File maintained for backward compatibility and will be removed on 1.0.
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
class Footnotes
{
/**
* Elements
*
* @var array
*/
private static $elements = array();
/**
* Add new element
*
* @param \PhpOffice\PhpWord\Element\Footnote $element
* @return integer Reference ID
*/
public static function addElement($element)
{
$rId = self::countElements() + 1;
self::$elements[$rId] = $element;
return $rId;
}
/**
* Set element
*
* @param integer $index
* @param \PhpOffice\PhpWord\Element\Footnote $element
*/
public static function setElement($index, $element)
{
if (array_key_exists($index, self::$elements)) {
self::$elements[$index] = $element;
}
}
/**
* Get element by index
*
* @param integer $index
* @return \PhpOffice\PhpWord\Element\Footnote
*/
public static function getElement($index)
{
if (array_key_exists($index, self::$elements)) {
return self::$elements[$index];
} else {
return null;
}
}
/**
* Get elements
*
* @return array
*/
public static function getElements()
{
return self::$elements;
}
/**
* Get element count
*
* @return integer
*/
public static function countElements()
{
return count(self::$elements);
}
/**
* Reset elements
*/
public static function resetElements()
{
self::$elements = array();
}
/**
* Add new footnote
*
* @param \PhpOffice\PhpWord\Element\Footnote $element
* @return integer Reference ID
*/
public static function addFootnoteElement($element)
{
return self::addElement($element);
}
/**
* Get Footnote Elements
*
* @return array
*/
public static function getFootnoteElements()
{
return self::getElements();
}
/**
* Get Footnote Elements Count
*
* @return integer
*/
public static function countFootnoteElements()
{
return self::countElements();
}
/**
* Add new Footnote Link Element
*
* @param string $linkSrc
* @return integer Reference ID
*/
public static function addFootnoteLinkElement($linkSrc)
{
return Media::addElement('footnotes', 'link', $linkSrc);
}
/**
* Get Footnote Link Elements
*
* @return array
*/
public static function getFootnoteLinkElements()
{
return Media::getElements('footnotes', 'link');
}
}

View File

@ -59,7 +59,7 @@ class Media
if (is_null($image)) {
throw new Exception('Image object not assigned.');
}
$isMemImage = $image->getIsMemImage();
$isMemImage = $image->isMemImage();
$extension = $image->getImageExtension();
$mediaData['imageExtension'] = $extension;
$mediaData['imageType'] = $image->getImageType();

View File

@ -37,7 +37,7 @@ abstract class AbstractReader implements ReaderInterface
*
* @return bool
*/
public function getReadDataOnly()
public function isReadDataOnly()
{
// return $this->readDataOnly;
return true;
@ -96,4 +96,15 @@ abstract class AbstractReader implements ReaderInterface
return true;
}
/**
* Read data only?
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getReadDataOnly()
{
return $this->isReadDataOnly();
}
}

View File

@ -91,6 +91,16 @@ class Settings
*/
private static $measurementUnit = self::UNIT_TWIP;
/**
* Return the compatibility option used by the XMLWriter
*
* @return bool Compatibility
*/
public static function hasCompatibility()
{
return self::$xmlWriterCompatibility;
}
/**
* Set the compatibility option used by the XMLWriter
*
@ -110,13 +120,13 @@ class Settings
}
/**
* Return the compatibility option used by the XMLWriter
* Get zip handler class
*
* @return bool Compatibility
* @return string
*/
public static function getCompatibility()
public static function getZipClass()
{
return self::$xmlWriterCompatibility;
return self::$zipClass;
}
/**
@ -136,16 +146,6 @@ class Settings
return false;
}
/**
* Get zip handler class
*
* @return string
*/
public static function getZipClass()
{
return self::$zipClass;
}
/**
* Set details of the external library for rendering PDF files
*
@ -237,4 +237,15 @@ class Settings
return true;
}
/**
* Return the compatibility option used by the XMLWriter
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public static function getCompatibility()
{
return self::hasCompatibility();
}
}

View File

@ -17,24 +17,24 @@ class Drawing
/**
* Convert pixels to EMU
*
* @param integer $pValue Value in pixels
* @param integer $value Value in pixels
* @return double Value in EMU
*/
public static function pixelsToEMU($pValue = 0)
public static function pixelsToEMU($value = 0)
{
return round($pValue * 9525);
return round($value * 9525);
}
/**
* Convert EMU to pixels
*
* @param integer $pValue Value in EMU
* @param integer $value Value in EMU
* @return integer Value in pixels
*/
public static function EMUToPixels($pValue = 0)
public static function emuToPixels($value = 0)
{
if ($pValue != 0) {
return round($pValue / 9525);
if ($value != 0) {
return round($value / 9525);
} else {
return 0;
}
@ -43,24 +43,24 @@ class Drawing
/**
* Convert pixels to points
*
* @param integer $pValue Value in pixels
* @param integer $value Value in pixels
* @return double Value in points
*/
public static function pixelsToPoints($pValue = 0)
public static function pixelsToPoints($value = 0)
{
return $pValue * 0.67777777;
return $value * 0.67777777;
}
/**
* Convert points width to pixels
*
* @param integer $pValue Value in points
* @param integer $value Value in points
* @return integer Value in pixels
*/
public static function pointsToPixels($pValue = 0)
public static function pointsToPixels($value = 0)
{
if ($pValue != 0) {
return $pValue * 1.333333333;
if ($value != 0) {
return $value * 1.333333333;
} else {
return 0;
}
@ -69,24 +69,24 @@ class Drawing
/**
* Convert degrees to angle
*
* @param integer $pValue Degrees
* @param integer $value Degrees
* @return integer Angle
*/
public static function degreesToAngle($pValue = 0)
public static function degreesToAngle($value = 0)
{
return (integer)round($pValue * 60000);
return (integer)round($value * 60000);
}
/**
* Convert angle to degrees
*
* @param integer $pValue Angle
* @param integer $value Angle
* @return integer Degrees
*/
public static function angleToDegrees($pValue = 0)
public static function angleToDegrees($value = 0)
{
if ($pValue != 0) {
return round($pValue / 60000);
if ($value != 0) {
return round($value / 60000);
} else {
return 0;
}
@ -95,24 +95,24 @@ class Drawing
/**
* Convert pixels to centimeters
*
* @param integer $pValue Value in pixels
* @param integer $value Value in pixels
* @return double Value in centimeters
*/
public static function pixelsToCentimeters($pValue = 0)
public static function pixelsToCentimeters($value = 0)
{
return $pValue * 0.028;
return $value * 0.028;
}
/**
* Convert centimeters width to pixels
*
* @param integer $pValue Value in centimeters
* @param integer $value Value in centimeters
* @return integer Value in pixels
*/
public static function centimetersToPixels($pValue = 0)
public static function centimetersToPixels($value = 0)
{
if ($pValue != 0) {
return $pValue / 0.028;
if ($value != 0) {
return $value / 0.028;
} else {
return 0;
}
@ -121,27 +121,27 @@ class Drawing
/**
* Convert HTML hexadecimal to RGB
*
* @param string $pValue HTML Color in hexadecimal
* @param string $value HTML Color in hexadecimal
* @return array Value in RGB
*/
public static function htmlToRGB($pValue)
public static function htmlToRGB($value)
{
if ($pValue[0] == '#') {
$pValue = substr($pValue, 1);
if ($value[0] == '#') {
$value = substr($value, 1);
}
if (strlen($pValue) == 6) {
list($color_R, $color_G, $color_B) = array($pValue[0] . $pValue[1], $pValue[2] . $pValue[3], $pValue[4] . $pValue[5]);
} elseif (strlen($pValue) == 3) {
list($color_R, $color_G, $color_B) = array($pValue[0] . $pValue[0], $pValue[1] . $pValue[1], $pValue[2] . $pValue[2]);
if (strlen($value) == 6) {
list($red, $green, $blue) = array($value[0] . $value[1], $value[2] . $value[3], $value[4] . $value[5]);
} elseif (strlen($value) == 3) {
list($red, $green, $blue) = array($value[0] . $value[0], $value[1] . $value[1], $value[2] . $value[2]);
} else {
return false;
}
$color_R = hexdec($color_R);
$color_G = hexdec($color_G);
$color_B = hexdec($color_B);
$red = hexdec($red);
$green = hexdec($green);
$blue = hexdec($blue);
return array($color_R, $color_G, $color_B);
return array($red, $green, $blue);
}
}

View File

@ -73,7 +73,7 @@ class XMLWriter
}
// Set xml Compatibility
$compatibility = Settings::getCompatibility();
$compatibility = Settings::hasCompatibility();
if ($compatibility) {
$this->xmlWriter->setIndent(false);
$this->xmlWriter->setIndentString('');

View File

@ -288,7 +288,7 @@ class Font extends AbstractStyle
*
* @return bool
*/
public function getBold()
public function isBold()
{
return $this->bold;
}
@ -311,7 +311,7 @@ class Font extends AbstractStyle
*
* @return bool
*/
public function getItalic()
public function isItalic()
{
return $this->italic;
}
@ -334,7 +334,7 @@ class Font extends AbstractStyle
*
* @return bool
*/
public function getSuperScript()
public function isSuperScript()
{
return $this->superScript;
}
@ -360,7 +360,7 @@ class Font extends AbstractStyle
*
* @return bool
*/
public function getSubScript()
public function isSubScript()
{
return $this->subScript;
}
@ -409,7 +409,7 @@ class Font extends AbstractStyle
*
* @return bool
*/
public function getStrikethrough()
public function isStrikethrough()
{
return $this->strikethrough;
}
@ -435,7 +435,7 @@ class Font extends AbstractStyle
*
* @return bool
*/
public function getDoubleStrikethrough()
public function isDoubleStrikethrough()
{
return $this->doubleStrikethrough;
}
@ -605,7 +605,7 @@ class Font extends AbstractStyle
*
* @return bool
*/
public function getSmallCaps()
public function isSmallCaps()
{
return $this->smallCaps;
}
@ -631,7 +631,7 @@ class Font extends AbstractStyle
*
* @return bool
*/
public function getAllCaps()
public function isAllCaps()
{
return $this->allCaps;
}
@ -681,4 +681,59 @@ class Font extends AbstractStyle
return $this;
}
/**
* Get bold
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getBold()
{
return $this->isBold();
}
/**
* Get italic
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getItalic()
{
return $this->isItalic();
}
/**
* Get superscript
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getSuperScript()
{
return $this->isSuperScript();
}
/**
* Get subscript
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getSubScript()
{
return $this->isSubScript();
}
/**
* Get strikethrough
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getStrikethrough()
{
return $this->isStrikethrough();
}
}

View File

@ -386,7 +386,7 @@ class Paragraph extends AbstractStyle
*
* @return bool
*/
public function getWidowControl()
public function hasWidowControl()
{
return $this->widowControl;
}
@ -411,7 +411,7 @@ class Paragraph extends AbstractStyle
*
* @return bool
*/
public function getKeepNext()
public function isKeepNext()
{
return $this->keepNext;
}
@ -436,7 +436,7 @@ class Paragraph extends AbstractStyle
*
* @return bool
*/
public function getKeepLines()
public function isKeepLines()
{
return $this->keepLines;
}
@ -461,7 +461,7 @@ class Paragraph extends AbstractStyle
*
* @return bool
*/
public function getPageBreakBefore()
public function hasPageBreakBefore()
{
return $this->pageBreakBefore;
}
@ -542,4 +542,48 @@ class Paragraph extends AbstractStyle
return $this;
}
/**
* Get allow first/last line to display on a separate page setting
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getWidowControl()
{
return $this->hasWidowControl();
}
/**
* Get keep paragraph with next paragraph setting
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getKeepNext()
{
return $this->isKeepNext();
}
/**
* Get keep all lines on one page setting
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getKeepLines()
{
return $this->isKeepLines();
}
/**
* Get start paragraph on next page setting
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getPageBreakBefore()
{
return $this->hasPageBreakBefore();
}
}

View File

@ -45,9 +45,19 @@ class Row extends AbstractStyle
}
/**
* Set tblHeader
* Is tblHeader
*
* @param boolean $value
* @return bool
*/
public function isTblHeader()
{
return $this->tblHeader;
}
/**
* Is tblHeader
*
* @param bool $value
* @return self
*/
public function setTblHeader($value = false)
@ -56,19 +66,19 @@ class Row extends AbstractStyle
}
/**
* Get tblHeader
* Is cantSplit
*
* @return boolean
* @return bool
*/
public function getTblHeader()
public function isCantSplit()
{
return $this->tblHeader;
return $this->cantSplit;
}
/**
* Set cantSplit
* Is cantSplit
*
* @param boolean $value
* @param bool $value
* @return self
*/
public function setCantSplit($value = false)
@ -77,13 +87,13 @@ class Row extends AbstractStyle
}
/**
* Get cantSplit
* Is exactHeight
*
* @return boolean
* @return bool
*/
public function getCantSplit()
public function isExactHeight()
{
return $this->cantSplit;
return $this->exactHeight;
}
/**
@ -98,13 +108,36 @@ class Row extends AbstractStyle
return $this;
}
/**
* Get tblHeader
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getTblHeader()
{
return $this->isTblHeader();
}
/**
* Get cantSplit
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getCantSplit()
{
return $this->isCantSplit();
}
/**
* Get exactHeight
*
* @return boolean
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getExactHeight()
{
return $this->exactHeight;
return $this->isExactHeight();
}
}

View File

@ -53,7 +53,7 @@ class TOC extends Tab
*/
public function setTabPos($value)
{
$this->position = $value;
$this->setPosition($value);
}
/**
@ -73,7 +73,7 @@ class TOC extends Tab
*/
public function setTabLeader($value = self::TABLEADER_DOT)
{
$this->leader = $value;
$this->setLeader($value);
}
/**

View File

@ -224,7 +224,7 @@ class Table extends Border
/**
* Set border size inside horizontal
*
* @param $value
* @param int $value
*/
public function setBorderInsideHSize($value = null)
{
@ -234,7 +234,7 @@ class Table extends Border
/**
* Get border size inside horizontal
*
* @return
* @return int
*/
public function getBorderInsideHSize()
{
@ -244,7 +244,7 @@ class Table extends Border
/**
* Set border size inside vertical
*
* @param $value
* @param int $value
*/
public function setBorderInsideVSize($value = null)
{
@ -254,7 +254,7 @@ class Table extends Border
/**
* Get border size inside vertical
*
* @return
* @return int
*/
public function getBorderInsideVSize()
{
@ -264,7 +264,7 @@ class Table extends Border
/**
* Set border color inside horizontal
*
* @param $value
* @param string $value
*/
public function setBorderInsideHColor($value = null)
{
@ -274,7 +274,7 @@ class Table extends Border
/**
* Get border color inside horizontal
*
* @return
* @return string
*/
public function getBorderInsideHColor()
{
@ -284,7 +284,7 @@ class Table extends Border
/**
* Set border color inside vertical
*
* @param $value
* @param string $value
*/
public function setBorderInsideVColor($value = null)
{
@ -294,7 +294,7 @@ class Table extends Border
/**
* Get border color inside vertical
*
* @return
* @return string
*/
public function getBorderInsideVColor()
{

View File

@ -1,84 +0,0 @@
<?php
/**
* PHPWord
*
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
*/
namespace PhpOffice\PhpWord;
/**
* Table of contents
*
* This static class has been deprecated and replaced by Collection\Titles.
* File maintained for backward compatibility and will be removed on 1.0.
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
class TOC
{
/**
* Title elements
*
* @var array
*/
private static $titles = array();
/**
* Title anchor
*
* @var int
*/
private static $anchor = 252634154;
/**
* Title bookmark
*
* @var int
*/
private static $bookmarkId = 0;
/**
* Add a Title
*
* @param string $text
* @param int $depth
* @return array
*/
public static function addTitle($text, $depth = 0)
{
$anchor = '_Toc' . ++self::$anchor;
$bookmarkId = self::$bookmarkId++;
$title = array();
$title['text'] = $text;
$title['depth'] = $depth;
$title['anchor'] = $anchor;
$title['bookmarkId'] = $bookmarkId;
self::$titles[] = $title;
return array($anchor, $bookmarkId);
}
/**
* Get all titles
*
* @return array
*/
public static function getTitles()
{
return self::$titles;
}
/**
* Reset titles
*/
public static function resetTitles()
{
self::$titles = array();
}
}

View File

@ -44,7 +44,7 @@ abstract class AbstractWriter implements WriterInterface
/**
* Use disk caching
*
* @var boolean
* @var bool
*/
private $useDiskCaching = false;
@ -121,9 +121,9 @@ abstract class AbstractWriter implements WriterInterface
/**
* Get use disk caching status
*
* @return boolean
* @return bool
*/
public function getUseDiskCaching()
public function isUseDiskCaching()
{
return $this->useDiskCaching;
}
@ -131,7 +131,7 @@ abstract class AbstractWriter implements WriterInterface
/**
* Set use disk caching status
*
* @param boolean $pValue
* @param bool $pValue
* @param string $pDirectory
* @return self
*/
@ -356,4 +356,15 @@ abstract class AbstractWriter implements WriterInterface
rmdir($dir);
}
/**
* Get use disk caching status
*
* @deprecated 0.10.0
* @codeCoverageIgnore
*/
public function getUseDiskCaching()
{
return $this->isUseDiskCaching();
}
}

View File

@ -41,22 +41,22 @@ class Font extends AbstractStyle
$css['color'] = '#' . $this->style->getColor();
}
$css['background'] = $this->style->getFgColor();
if ($this->style->getBold()) {
if ($this->style->isBold()) {
$css['font-weight'] = 'bold';
}
if ($this->style->getItalic()) {
if ($this->style->isItalic()) {
$css['font-style'] = 'italic';
}
if ($this->style->getSuperScript()) {
if ($this->style->isSuperScript()) {
$css['vertical-align'] = 'super';
} elseif ($this->style->getSubScript()) {
} elseif ($this->style->isSubScript()) {
$css['vertical-align'] = 'sub';
}
$css['text-decoration'] = '';
if ($this->style->getUnderline() != FontStyle::UNDERLINE_NONE) {
$css['text-decoration'] .= 'underline ';
}
if ($this->style->getStrikethrough()) {
if ($this->style->isStrikethrough()) {
$css['text-decoration'] .= 'line-through ';
}

View File

@ -25,12 +25,12 @@ class Text extends Element
$paragraphStyle = $this->element->getParagraphStyle();
// @todo Commented for TextRun. Should really checkout this value
// $SfIsObject = ($fontStyle instanceof Font) ? true : false;
$SfIsObject = false;
// $fStyleIsObject = ($fontStyle instanceof Font) ? true : false;
$fStyleIsObject = false;
if ($SfIsObject) {
if ($fStyleIsObject) {
// Don't never be the case, because I browse all sections for cleaning all styles not declared
throw new Exception('PhpWord : $SfIsObject wouldn\'t be an object');
throw new Exception('PhpWord : $fStyleIsObject wouldn\'t be an object');
} else {
if (!$this->withoutP) {
$this->xmlWriter->startElement('text:p'); // text:p

View File

@ -48,12 +48,12 @@ class Font extends AbstractStyle
if ($this->style->getColor()) {
$this->xmlWriter->writeAttribute('fo:color', '#' . $this->style->getColor());
}
if ($this->style->getItalic()) {
if ($this->style->isItalic()) {
$this->xmlWriter->writeAttribute('fo:font-style', 'italic');
$this->xmlWriter->writeAttribute('style:font-style-asian', 'italic');
$this->xmlWriter->writeAttribute('style:font-style-complex', 'italic');
}
if ($this->style->getBold()) {
if ($this->style->isBold()) {
$this->xmlWriter->writeAttribute('fo:font-weight', 'bold');
$this->xmlWriter->writeAttribute('style:font-weight-asian', 'bold');
}

View File

@ -73,10 +73,10 @@ class Text extends Element
} else {
$rtfText .= '\f0';
}
if ($fontStyle->getBold()) {
if ($fontStyle->isBold()) {
$rtfText .= '\b';
}
if ($fontStyle->getItalic()) {
if ($fontStyle->isItalic()) {
$rtfText .= '\i';
}
if ($fontStyle->getSize()) {
@ -92,10 +92,10 @@ class Text extends Element
$rtfText .= '\cf0';
$rtfText .= '\f0';
if ($fontStyle->getBold()) {
if ($fontStyle->isBold()) {
$rtfText .= '\b0';
}
if ($fontStyle->getItalic()) {
if ($fontStyle->isItalic()) {
$rtfText .= '\i0';
}
if ($fontStyle->getSize()) {

View File

@ -23,7 +23,7 @@ class Image extends Element
*/
public function write()
{
if ($this->element->getIsWatermark()) {
if ($this->element->isWatermark()) {
$this->writeWatermark();
} else {
$this->writeImage();

View File

@ -84,25 +84,22 @@ class Table extends Element
$row = $rows[$i];
$height = $row->getHeight();
$rowStyle = $row->getStyle();
$tblHeader = $rowStyle->getTblHeader();
$cantSplit = $rowStyle->getCantSplit();
$exactHeight = $rowStyle->getExactHeight();
$this->xmlWriter->startElement('w:tr');
if (!is_null($height) || !is_null($tblHeader) || !is_null($cantSplit)) {
if (!is_null($height) || $rowStyle->isTblHeader() || $rowStyle->isCantSplit()) {
$this->xmlWriter->startElement('w:trPr');
if (!is_null($height)) {
$this->xmlWriter->startElement('w:trHeight');
$this->xmlWriter->writeAttribute('w:val', $height);
$this->xmlWriter->writeAttribute('w:hRule', ($exactHeight ? 'exact' : 'atLeast'));
$this->xmlWriter->writeAttribute('w:hRule', ($rowStyle->isExactHeight() ? 'exact' : 'atLeast'));
$this->xmlWriter->endElement();
}
if ($tblHeader) {
if ($rowStyle->isTblHeader()) {
$this->xmlWriter->startElement('w:tblHeader');
$this->xmlWriter->writeAttribute('w:val', '1');
$this->xmlWriter->endElement();
}
if ($cantSplit) {
if ($rowStyle->isCantSplit()) {
$this->xmlWriter->startElement('w:cantSplit');
$this->xmlWriter->writeAttribute('w:val', '1');
$this->xmlWriter->endElement();

View File

@ -63,7 +63,7 @@ abstract class AbstractPart
{
$useDiskCaching = false;
if (!is_null($this->parentWriter)) {
if ($this->parentWriter->getUseDiskCaching()) {
if ($this->parentWriter->isUseDiskCaching()) {
$useDiskCaching = true;
}
}

View File

@ -24,24 +24,24 @@ class ContentTypes extends AbstractPart
*/
public function writeContentTypes($contentTypes)
{
$OpenXMLPrefix = 'application/vnd.openxmlformats-';
$WordMLPrefix = $OpenXMLPrefix . 'officedocument.wordprocessingml.';
$openXMLPrefix = 'application/vnd.openxmlformats-';
$wordMLPrefix = $openXMLPrefix . 'officedocument.wordprocessingml.';
$overrides = array(
'/docProps/core.xml' => $OpenXMLPrefix . 'package.core-properties+xml',
'/docProps/app.xml' => $OpenXMLPrefix . 'officedocument.extended-properties+xml',
'/word/document.xml' => $WordMLPrefix . 'document.main+xml',
'/word/styles.xml' => $WordMLPrefix . 'styles+xml',
'/word/numbering.xml' => $WordMLPrefix . 'numbering+xml',
'/word/settings.xml' => $WordMLPrefix . 'settings+xml',
'/word/theme/theme1.xml' => $OpenXMLPrefix . 'officedocument.theme+xml',
'/word/webSettings.xml' => $WordMLPrefix . 'webSettings+xml',
'/word/fontTable.xml' => $WordMLPrefix . 'fontTable+xml',
'/docProps/core.xml' => $openXMLPrefix . 'package.core-properties+xml',
'/docProps/app.xml' => $openXMLPrefix . 'officedocument.extended-properties+xml',
'/word/document.xml' => $wordMLPrefix . 'document.main+xml',
'/word/styles.xml' => $wordMLPrefix . 'styles+xml',
'/word/numbering.xml' => $wordMLPrefix . 'numbering+xml',
'/word/settings.xml' => $wordMLPrefix . 'settings+xml',
'/word/theme/theme1.xml' => $openXMLPrefix . 'officedocument.theme+xml',
'/word/webSettings.xml' => $wordMLPrefix . 'webSettings+xml',
'/word/fontTable.xml' => $wordMLPrefix . 'fontTable+xml',
);
$defaults = $contentTypes['default'];
if (!empty($contentTypes['override'])) {
foreach ($contentTypes['override'] as $key => $val) {
$overrides[$key] = $WordMLPrefix . $val . '+xml';
$overrides[$key] = $wordMLPrefix . $val . '+xml';
}
}

View File

@ -89,12 +89,12 @@ class Font extends AbstractStyle
}
// Bold
if ($this->style->getBold()) {
if ($this->style->isBold()) {
$this->xmlWriter->writeElement('w:b', null);
}
// Italic
if ($this->style->getItalic()) {
if ($this->style->isItalic()) {
$this->xmlWriter->writeElement('w:i', null);
$this->xmlWriter->writeElement('w:iCs', null);
}
@ -107,12 +107,12 @@ class Font extends AbstractStyle
}
// Strikethrough
if ($this->style->getStrikethrough()) {
if ($this->style->isStrikethrough()) {
$this->xmlWriter->writeElement('w:strike', null);
}
// Double strikethrough
if ($this->style->getDoubleStrikethrough()) {
if ($this->style->isDoubleStrikethrough()) {
$this->xmlWriter->writeElement('w:dstrike', null);
}
@ -130,19 +130,19 @@ class Font extends AbstractStyle
}
// Superscript/subscript
if ($this->style->getSuperScript() || $this->style->getSubScript()) {
if ($this->style->isSuperScript() || $this->style->isSubScript()) {
$this->xmlWriter->startElement('w:vertAlign');
$this->xmlWriter->writeAttribute('w:val', $this->style->getSuperScript() ? 'superscript' : 'subscript');
$this->xmlWriter->writeAttribute('w:val', $this->style->isSuperScript() ? 'superscript' : 'subscript');
$this->xmlWriter->endElement();
}
// Small caps
if ($this->style->getSmallCaps()) {
if ($this->style->isSmallCaps()) {
$this->xmlWriter->writeElement('w:smallCaps', null);
}
// All caps
if ($this->style->getAllCaps()) {
if ($this->style->isAllCaps()) {
$this->xmlWriter->writeElement('w:caps', null);
}

View File

@ -64,11 +64,6 @@ class Paragraph extends AbstractStyle
return;
}
$widowControl = $this->style->getWidowControl();
$keepNext = $this->style->getKeepNext();
$keepLines = $this->style->getKeepLines();
$pageBreakBefore = $this->style->getPageBreakBefore();
if (!$this->withoutPPR) {
$this->xmlWriter->startElement('w:pPr');
}
@ -93,22 +88,22 @@ class Paragraph extends AbstractStyle
}
// Pagination
if (!$widowControl) {
if (!$this->style->hasWidowControl()) {
$this->xmlWriter->startElement('w:widowControl');
$this->xmlWriter->writeAttribute('w:val', '0');
$this->xmlWriter->endElement();
}
if ($keepNext) {
if ($this->style->isKeepNext()) {
$this->xmlWriter->startElement('w:keepNext');
$this->xmlWriter->writeAttribute('w:val', '1');
$this->xmlWriter->endElement();
}
if ($keepLines) {
if ($this->style->isKeepLines()) {
$this->xmlWriter->startElement('w:keepLines');
$this->xmlWriter->writeAttribute('w:val', '1');
$this->xmlWriter->endElement();
}
if ($pageBreakBefore) {
if ($this->style->hasPageBreakBefore()) {
$this->xmlWriter->startElement('w:pageBreakBefore');
$this->xmlWriter->writeAttribute('w:val', '1');
$this->xmlWriter->endElement();

View File

@ -29,7 +29,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Image', $oImage);
$this->assertEquals($oImage->getSource(), $src);
$this->assertEquals($oImage->getMediaId(), md5($src));
$this->assertEquals($oImage->getIsWatermark(), false);
$this->assertEquals($oImage->isWatermark(), false);
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\Image', $oImage->getStyle());
}
@ -72,7 +72,7 @@ class ImageTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($image->getImageExtension(), $extension);
$this->assertEquals($image->getImageCreateFunction(), $createFunction);
$this->assertEquals($image->getImageFunction(), $imageFunction);
$this->assertFalse($image->getIsMemImage());
$this->assertFalse($image->isMemImage());
}
}

View File

@ -23,9 +23,9 @@ class SettingsTest extends \PHPUnit_Framework_TestCase
*/
public function testSetGetCompatibility()
{
$this->assertTrue(Settings::getCompatibility());
$this->assertTrue(Settings::hasCompatibility());
$this->assertTrue(Settings::setCompatibility(false));
$this->assertFalse(Settings::getCompatibility());
$this->assertFalse(Settings::hasCompatibility());
$this->assertFalse(Settings::setCompatibility('Non boolean'));
}

View File

@ -32,7 +32,7 @@ class DrawingTest extends \PHPUnit_Framework_TestCase
$result = Drawing::pixelsToEMU($value);
$this->assertEquals(round($value * 9525), $result);
$result = Drawing::EMUToPixels($value);
$result = Drawing::emuToPixels($value);
$this->assertEquals(round($value / 9525), $result);
$result = Drawing::pixelsToPoints($value);

View File

@ -129,7 +129,7 @@ class ODTextTest extends \PHPUnit_Framework_TestCase
{
$object = new ODText();
$object->setUseDiskCaching(true, PHPWORD_TESTS_BASE_DIR);
$this->assertTrue($object->getUseDiskCaching());
$this->assertTrue($object->isUseDiskCaching());
$this->assertEquals(PHPWORD_TESTS_BASE_DIR, $object->getDiskCachingDirectory());
}

View File

@ -177,7 +177,7 @@ class Word2007Test extends \PHPUnit_Framework_TestCase
$writer = new Word2007($phpWord);
$writer->save('php://output');
$this->assertTrue($object->getUseDiskCaching());
$this->assertTrue($object->isUseDiskCaching());
}
/**