diff --git a/Classes/PHPWord/HashTable.php b/Classes/PHPWord/HashTable.php index f2ef3148f1..22c602b8ca 100755 --- a/Classes/PHPWord/HashTable.php +++ b/Classes/PHPWord/HashTable.php @@ -27,6 +27,8 @@ /** * PHPWord_HashTable + * + * @codeCoverageIgnore Legacy from PHPExcel */ class PHPWord_HashTable { diff --git a/Classes/PHPWord/Section.php b/Classes/PHPWord/Section.php index bdf37f81da..db127b5e73 100755 --- a/Classes/PHPWord/Section.php +++ b/Classes/PHPWord/Section.php @@ -117,7 +117,7 @@ public function getSettings() */ public function addText($text, $styleFont = null, $styleParagraph = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $text = new PHPWord_Section_Text($text, $styleFont, $styleParagraph); @@ -136,11 +136,11 @@ public function addText($text, $styleFont = null, $styleParagraph = null) */ public function addLink($linkSrc, $linkName = null, $styleFont = null, $styleParagraph = null) { - if (!PHPWord_Shared_String::IsUTF8($linkSrc)) { + if (!PHPWord_Shared_String::isUTF8($linkSrc)) { $linkSrc = utf8_encode($linkSrc); } if (!is_null($linkName)) { - if (!PHPWord_Shared_String::IsUTF8($linkName)) { + if (!PHPWord_Shared_String::isUTF8($linkName)) { $linkName = utf8_encode($linkName); } } @@ -198,7 +198,7 @@ public function addTable($style = null) */ public function addListItem($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $listItem = new PHPWord_Section_ListItem($text, $depth, $styleFont, $styleList, $styleParagraph); @@ -319,7 +319,7 @@ public function addTOC($styleFont = null, $styleTOC = null) */ public function addTitle($text, $depth = 1) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $styles = PHPWord_Style::getStyles(); diff --git a/Classes/PHPWord/Section/Footer.php b/Classes/PHPWord/Section/Footer.php index 3455adc9c9..4d7b458d44 100755 --- a/Classes/PHPWord/Section/Footer.php +++ b/Classes/PHPWord/Section/Footer.php @@ -70,7 +70,7 @@ public function __construct($sectionCount) */ public function addText($text, $styleFont = null, $styleParagraph = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $text = new PHPWord_Section_Text($text, $styleFont, $styleParagraph); @@ -168,7 +168,7 @@ public function addMemoryImage($link, $style = null) */ public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $ptext = new PHPWord_Section_Footer_PreserveText($text, $styleFont, $styleParagraph); diff --git a/Classes/PHPWord/Section/Header.php b/Classes/PHPWord/Section/Header.php index 83c82c4973..cd588813d5 100755 --- a/Classes/PHPWord/Section/Header.php +++ b/Classes/PHPWord/Section/Header.php @@ -99,7 +99,7 @@ public function __construct($sectionCount) */ public function addText($text, $styleFont = null, $styleParagraph = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $text = new PHPWord_Section_Text($text, $styleFont, $styleParagraph); @@ -197,7 +197,7 @@ public function addMemoryImage($link, $style = null) */ public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $ptext = new PHPWord_Section_Footer_PreserveText($text, $styleFont, $styleParagraph); diff --git a/Classes/PHPWord/Section/Table/Cell.php b/Classes/PHPWord/Section/Table/Cell.php index 898c6bf2b2..f2f3839a2b 100755 --- a/Classes/PHPWord/Section/Table/Cell.php +++ b/Classes/PHPWord/Section/Table/Cell.php @@ -105,7 +105,7 @@ public function __construct($insideOf, $pCount, $width = null, $style = null) */ public function addText($text, $styleFont = null, $styleParagraph = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $text = new PHPWord_Section_Text($text, $styleFont, $styleParagraph); @@ -124,11 +124,11 @@ public function addText($text, $styleFont = null, $styleParagraph = null) public function addLink($linkSrc, $linkName = null, $style = null) { if ($this->_insideOf == 'section') { - if (!PHPWord_Shared_String::IsUTF8($linkSrc)) { + if (!PHPWord_Shared_String::isUTF8($linkSrc)) { $linkSrc = utf8_encode($linkSrc); } if (!is_null($linkName)) { - if (!PHPWord_Shared_String::IsUTF8($linkName)) { + if (!PHPWord_Shared_String::isUTF8($linkName)) { $linkName = utf8_encode($linkName); } } @@ -166,7 +166,7 @@ public function addTextBreak() */ public function addListItem($text, $depth = 0, $styleText = null, $styleList = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $listItem = new PHPWord_Section_ListItem($text, $depth, $styleText, $styleList); @@ -281,7 +281,7 @@ public function addObject($src, $style = null) public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { if ($this->_insideOf == 'footer' || $this->_insideOf == 'header') { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $ptext = new PHPWord_Section_Footer_PreserveText($text, $styleFont, $styleParagraph); diff --git a/Classes/PHPWord/Section/Table/Row.php b/Classes/PHPWord/Section/Table/Row.php index d174ef8f46..ef3d57e5e7 100644 --- a/Classes/PHPWord/Section/Table/Row.php +++ b/Classes/PHPWord/Section/Table/Row.php @@ -20,7 +20,7 @@ * * @category PHPWord * @package PHPWord - * @copyright Copyright (c) 2013 PHPWord + * @copyright Copyright (c) 2014 PHPWord * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version 0.7.0 */ diff --git a/Classes/PHPWord/Section/TextRun.php b/Classes/PHPWord/Section/TextRun.php index eeb936a0db..4af152f6df 100755 --- a/Classes/PHPWord/Section/TextRun.php +++ b/Classes/PHPWord/Section/TextRun.php @@ -78,7 +78,7 @@ public function __construct($styleParagraph = null) */ public function addText($text = null, $styleFont = null) { - if (!PHPWord_Shared_String::IsUTF8($text)) { + if (!PHPWord_Shared_String::isUTF8($text)) { $text = utf8_encode($text); } $text = new PHPWord_Section_Text($text, $styleFont); diff --git a/Classes/PHPWord/Shared/File.php b/Classes/PHPWord/Shared/File.php index 84cd2e8450..274736a166 100755 --- a/Classes/PHPWord/Shared/File.php +++ b/Classes/PHPWord/Shared/File.php @@ -36,7 +36,7 @@ class PHPWord_Shared_File * @param string $pFilename Filename * @return bool */ - public static function file_exists($pFilename) + public static function fileExists($pFilename) { // Sick construction, but it seems that // file_exists returns strange values when diff --git a/Classes/PHPWord/Shared/String.php b/Classes/PHPWord/Shared/String.php index 2aa68d3fea..db92bd48db 100755 --- a/Classes/PHPWord/Shared/String.php +++ b/Classes/PHPWord/Shared/String.php @@ -113,7 +113,7 @@ public static function getIsIconvEnabled() * @param string $value Value to unescape * @return string */ - public static function ControlCharacterOOXML2PHP($value = '') + public static function controlCharacterOOXML2PHP($value = '') { if (empty(self::$_controlCharacters)) { self::_buildControlCharacters(); @@ -136,7 +136,7 @@ public static function ControlCharacterOOXML2PHP($value = '') * @param string $value Value to escape * @return string */ - public static function ControlCharacterPHP2OOXML($value = '') + public static function controlCharacterPHP2OOXML($value = '') { if (empty(self::$_controlCharacters)) { self::_buildControlCharacters(); @@ -151,7 +151,7 @@ public static function ControlCharacterPHP2OOXML($value = '') * @param string $value * @return boolean */ - public static function IsUTF8($value = '') + public static function isUTF8($value = '') { return $value === '' || preg_match('/^./su', $value) === 1; } @@ -162,7 +162,7 @@ public static function IsUTF8($value = '') * @param mixed $value * @return string */ - public static function FormatNumber($value) + public static function formatNumber($value) { return number_format($value, 2, '.', ''); } @@ -180,14 +180,14 @@ public static function FormatNumber($value) public static function UTF8toBIFF8UnicodeShort($value) { // character count - $ln = self::CountCharacters($value, 'UTF-8'); + $ln = self::countCharacters($value, 'UTF-8'); // option flags $opt = (self::getIsMbstringEnabled() || self::getIsIconvEnabled()) ? 0x0001 : 0x0000; // characters - $chars = self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8'); + $chars = self::convertEncoding($value, 'UTF-16LE', 'UTF-8'); $data = pack('CC', $ln, $opt) . $chars; return $data; @@ -206,14 +206,14 @@ public static function UTF8toBIFF8UnicodeShort($value) public static function UTF8toBIFF8UnicodeLong($value) { // character count - $ln = self::CountCharacters($value, 'UTF-8'); + $ln = self::countCharacters($value, 'UTF-8'); // option flags $opt = (self::getIsMbstringEnabled() || self::getIsIconvEnabled()) ? 0x0001 : 0x0000; // characters - $chars = self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8'); + $chars = self::convertEncoding($value, 'UTF-16LE', 'UTF-8'); $data = pack('vC', $ln, $opt) . $chars; return $data; @@ -227,7 +227,7 @@ public static function UTF8toBIFF8UnicodeLong($value) * @param string $from Encoding to convert from, e.g. 'UTF-16LE' * @return string */ - public static function ConvertEncoding($value, $to, $from) + public static function convertEncoding($value, $to, $from) { if (self::getIsMbstringEnabled()) { $value = mb_convert_encoding($value, $to, $from); @@ -250,7 +250,7 @@ public static function ConvertEncoding($value, $to, $from) * @param string $enc Encoding * @return int Character count */ - public static function CountCharacters($value, $enc = 'UTF-8') + public static function countCharacters($value, $enc = 'UTF-8') { if (self::getIsMbstringEnabled()) { $count = mb_strlen($value, $enc); diff --git a/Classes/PHPWord/Shared/ZipStreamWrapper.php b/Classes/PHPWord/Shared/ZipStreamWrapper.php index ee3469215b..a2de0dbdb5 100755 --- a/Classes/PHPWord/Shared/ZipStreamWrapper.php +++ b/Classes/PHPWord/Shared/ZipStreamWrapper.php @@ -30,6 +30,8 @@ /** * Class PHPWord_Shared_ZipStreamWrapper + * + * @codeCoverageIgnore Legacy from PHPExcel */ class PHPWord_Shared_ZipStreamWrapper { @@ -73,7 +75,7 @@ public static function register() /** * Open stream */ - public function stream_open($path, $mode, $options, &$opened_path) + public function streamOpen($path, $mode, $options, &$opened_path) { // Check for mode if ($mode{0} != 'r') { @@ -113,7 +115,7 @@ public function stream_open($path, $mode, $options, &$opened_path) /** * Stat stream */ - public function stream_stat() + public function streamStat() { return $this->_archive->statName($this->_fileNameInArchive); } @@ -121,7 +123,7 @@ public function stream_stat() /** * Read stream */ - public function stream_read($count) + public function streamRead($count) { $ret = substr($this->_data, $this->_position, $count); $this->_position += strlen($ret); @@ -131,7 +133,7 @@ public function stream_read($count) /** * Tell stream */ - public function stream_tell() + public function streamTell() { return $this->_position; } @@ -139,7 +141,7 @@ public function stream_tell() /** * EOF stream */ - public function stream_eof() + public function streamEOF() { return $this->_position >= strlen($this->_data); } @@ -147,7 +149,7 @@ public function stream_eof() /** * Seek stream */ - public function stream_seek($offset, $whence) + public function streamSeek($offset, $whence) { switch ($whence) { case SEEK_SET: diff --git a/Classes/PHPWord/Style/Row.php b/Classes/PHPWord/Style/Row.php index c7140d5897..96845a0ddd 100644 --- a/Classes/PHPWord/Style/Row.php +++ b/Classes/PHPWord/Style/Row.php @@ -20,7 +20,7 @@ * * @category PHPWord * @package PHPWord - * @copyright Copyright (c) 2013 PHPWord + * @copyright Copyright (c) 2014 PHPWord * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version 0.7.0 */ diff --git a/Classes/PHPWord/Template.php b/Classes/PHPWord/Template.php index 840d22950a..0b56743e9a 100755 --- a/Classes/PHPWord/Template.php +++ b/Classes/PHPWord/Template.php @@ -50,7 +50,7 @@ class PHPWord_Template * * @var string */ - private $_documentXML; + private $documentXML; /** @@ -70,7 +70,7 @@ public function __construct($strFilename) $this->_objZip = new ZipArchive(); $this->_objZip->open($this->_tempFileName); - $this->_documentXML = $this->_objZip->getFromName('word/document.xml'); + $this->documentXML = $this->_objZip->getFromName('word/document.xml'); } else { throw new PHPWord_Exception('Could not create temporary file with unique name in the default temporary directory.'); } @@ -94,7 +94,7 @@ public function applyXslStyleSheet(&$xslDOMDocument, $xslOptions = array(), $xsl } $xmlDOMDocument = new \DOMDocument(); - if ($xmlDOMDocument->loadXML($this->_documentXML) === false) { + if ($xmlDOMDocument->loadXML($this->documentXML) === false) { throw new \Exception('Could not load XML from the given template.'); } @@ -103,7 +103,7 @@ public function applyXslStyleSheet(&$xslDOMDocument, $xslOptions = array(), $xsl throw new \Exception('Could not transform the given XML document.'); } - $this->_documentXML = $xmlTransformed; + $this->documentXML = $xmlTransformed; } /** @@ -116,11 +116,11 @@ public function applyXslStyleSheet(&$xslDOMDocument, $xslOptions = array(), $xsl public function setValue($search, $replace, $limit = -1) { $pattern = '|\$\{([^\}]+)\}|U'; - preg_match_all($pattern, $this->_documentXML, $matches); + preg_match_all($pattern, $this->documentXML, $matches); foreach ($matches[0] as $value) { $valueCleaned = preg_replace('/<[^>]+>/', '', $value); $valueCleaned = preg_replace('/<\/[^>]+>/', '', $valueCleaned); - $this->_documentXML = str_replace($value, $valueCleaned, $this->_documentXML); + $this->documentXML = str_replace($value, $valueCleaned, $this->documentXML); } if (substr($search, 0, 2) !== '${' && substr($search, -1) !== '}') { @@ -128,7 +128,7 @@ public function setValue($search, $replace, $limit = -1) } if (!is_array($replace)) { - if (!PHPWord_Shared_String::IsUTF8($replace)) { + if (!PHPWord_Shared_String::isUTF8($replace)) { $replace = utf8_encode($replace); } $replace = htmlspecialchars($replace); @@ -140,7 +140,7 @@ public function setValue($search, $replace, $limit = -1) $regExpDelim = '/'; $escapedSearch = preg_quote($search, $regExpDelim); - $this->_documentXML = preg_replace("{$regExpDelim}{$escapedSearch}{$regExpDelim}u", $replace, $this->_documentXML, $limit); + $this->documentXML = preg_replace("{$regExpDelim}{$escapedSearch}{$regExpDelim}u", $replace, $this->documentXML, $limit); } /** @@ -148,7 +148,7 @@ public function setValue($search, $replace, $limit = -1) */ public function getVariables() { - preg_match_all('/\$\{(.*?)}/i', $this->_documentXML, $matches); + preg_match_all('/\$\{(.*?)}/i', $this->documentXML, $matches); return $matches[1]; } @@ -159,9 +159,9 @@ public function getVariables() */ private function _findRowStart($offset) { - $rowStart = strrpos($this->_documentXML, "_documentXML) - $offset) * -1)); + $rowStart = strrpos($this->documentXML, "documentXML) - $offset) * -1)); if (!$rowStart) { - $rowStart = strrpos($this->_documentXML, "", ((strlen($this->_documentXML) - $offset) * -1)); + $rowStart = strrpos($this->documentXML, "", ((strlen($this->documentXML) - $offset) * -1)); } if (!$rowStart) { throw new Exception("Can not find the start position of the row to clone."); @@ -177,7 +177,7 @@ private function _findRowStart($offset) */ private function _findRowEnd($offset) { - $rowEnd = strpos($this->_documentXML, "", $offset) + 7; + $rowEnd = strpos($this->documentXML, "", $offset) + 7; return $rowEnd; } @@ -189,9 +189,9 @@ private function _findRowEnd($offset) private function _getSlice($startPosition, $endPosition = 0) { if (!$endPosition) { - $endPosition = strlen($this->_documentXML); + $endPosition = strlen($this->documentXML); } - return substr($this->_documentXML, $startPosition, ($endPosition - $startPosition)); + return substr($this->documentXML, $startPosition, ($endPosition - $startPosition)); } /** @@ -206,7 +206,7 @@ public function cloneRow($search, $numberOfClones) $search = '${'.$search.'}'; } - $tagPos = strpos($this->_documentXML, $search); + $tagPos = strpos($this->documentXML, $search); if (!$tagPos) { throw new Exception("Can not clone row, template variable not found or variable contains markup."); return false; @@ -246,7 +246,7 @@ public function cloneRow($search, $numberOfClones) } $result .= $this->_getSlice($rowEnd); - $this->_documentXML = $result; + $this->documentXML = $result; } /** @@ -256,7 +256,7 @@ public function cloneRow($search, $numberOfClones) */ public function save() { - $this->_objZip->addFromString('word/document.xml', $this->_documentXML); + $this->_objZip->addFromString('word/document.xml', $this->documentXML); // Close zip file if ($this->_objZip->close() === false) { diff --git a/Classes/PHPWord/Writer/ODText.php b/Classes/PHPWord/Writer/ODText.php index 7177563075..18cea7b7bf 100755 --- a/Classes/PHPWord/Writer/ODText.php +++ b/Classes/PHPWord/Writer/ODText.php @@ -35,35 +35,35 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter * * @var PHPWord */ - private $_document; + private $document; /** * Private writer parts * * @var PHPWord_Writer_ODText_WriterPart[] */ - private $_writerParts; + private $writerParts; /** * Private unique PHPWord_Worksheet_BaseDrawing HashTable * * @var PHPWord_HashTable */ - private $_drawingHashTable; + private $drawingHashTable; /** * Use disk caching where possible? * * @var boolean */ - private $_useDiskCaching = false; + private $useDiskCaching = false; /** * Disk caching directory * * @var string */ - private $_diskCachingDirectory; + private $diskCachingDirectory; /** * Create a new PHPWord_Writer_ODText @@ -76,23 +76,23 @@ public function __construct(PHPWord $pPHPWord = null) $this->setPHPWord($pPHPWord); // Set up disk caching location - $this->_diskCachingDirectory = './'; + $this->diskCachingDirectory = './'; // Initialise writer parts - $this->_writerParts['content'] = new PHPWord_Writer_ODText_Content(); - $this->_writerParts['manifest'] = new PHPWord_Writer_ODText_Manifest(); - $this->_writerParts['meta'] = new PHPWord_Writer_ODText_Meta(); - $this->_writerParts['mimetype'] = new PHPWord_Writer_ODText_Mimetype(); - $this->_writerParts['styles'] = new PHPWord_Writer_ODText_Styles(); + $this->writerParts['content'] = new PHPWord_Writer_ODText_Content(); + $this->writerParts['manifest'] = new PHPWord_Writer_ODText_Manifest(); + $this->writerParts['meta'] = new PHPWord_Writer_ODText_Meta(); + $this->writerParts['mimetype'] = new PHPWord_Writer_ODText_Mimetype(); + $this->writerParts['styles'] = new PHPWord_Writer_ODText_Styles(); // Assign parent IWriter - foreach ($this->_writerParts as $writer) { + foreach ($this->writerParts as $writer) { $writer->setParentWriter($this); } // Set HashTable variables - $this->_drawingHashTable = new PHPWord_HashTable(); + $this->drawingHashTable = new PHPWord_HashTable(); } /** @@ -103,7 +103,7 @@ public function __construct(PHPWord $pPHPWord = null) */ public function save($pFilename = null) { - if (!is_null($this->_document)) { + if (!is_null($this->document)) { // If $pFilename is php://output or php://stdout, make it a temporary file... $originalFilename = $pFilename; if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { @@ -127,19 +127,19 @@ public function save($pFilename = null) // Add mimetype to ZIP file //@todo Not in ZIPARCHIVE::CM_STORE mode - $objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->writeMimetype($this->_document)); + $objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->writeMimetype($this->document)); // Add content.xml to ZIP file - $objZip->addFromString('content.xml', $this->getWriterPart('content')->writeContent($this->_document)); + $objZip->addFromString('content.xml', $this->getWriterPart('content')->writeContent($this->document)); // Add meta.xml to ZIP file - $objZip->addFromString('meta.xml', $this->getWriterPart('meta')->writeMeta($this->_document)); + $objZip->addFromString('meta.xml', $this->getWriterPart('meta')->writeMeta($this->document)); // Add styles.xml to ZIP file - $objZip->addFromString('styles.xml', $this->getWriterPart('styles')->writeStyles($this->_document)); + $objZip->addFromString('styles.xml', $this->getWriterPart('styles')->writeStyles($this->document)); // Add META-INF/manifest.xml - $objZip->addFromString('META-INF/manifest.xml', $this->getWriterPart('manifest')->writeManifest($this->_document)); + $objZip->addFromString('META-INF/manifest.xml', $this->getWriterPart('manifest')->writeManifest($this->document)); // Add media for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) { @@ -200,8 +200,8 @@ public function save($pFilename = null) */ public function getPHPWord() { - if (!is_null($this->_document)) { - return $this->_document; + if (!is_null($this->document)) { + return $this->document; } else { throw new Exception("No PHPWord assigned."); } @@ -216,7 +216,7 @@ public function getPHPWord() */ public function setPHPWord(PHPWord $pPHPWord = null) { - $this->_document = $pPHPWord; + $this->document = $pPHPWord; return $this; } @@ -227,7 +227,7 @@ public function setPHPWord(PHPWord $pPHPWord = null) */ public function getDrawingHashTable() { - return $this->_drawingHashTable; + return $this->drawingHashTable; } /** @@ -238,8 +238,8 @@ public function getDrawingHashTable() */ public function getWriterPart($pPartName = '') { - if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) { - return $this->_writerParts[strtolower($pPartName)]; + if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) { + return $this->writerParts[strtolower($pPartName)]; } else { return null; } @@ -252,7 +252,7 @@ public function getWriterPart($pPartName = '') */ public function getUseDiskCaching() { - return $this->_useDiskCaching; + return $this->useDiskCaching; } /** @@ -265,11 +265,11 @@ public function getUseDiskCaching() */ public function setUseDiskCaching($pValue = false, $pDirectory = null) { - $this->_useDiskCaching = $pValue; + $this->useDiskCaching = $pValue; if (!is_null($pDirectory)) { if (is_dir($pDirectory)) { - $this->_diskCachingDirectory = $pDirectory; + $this->diskCachingDirectory = $pDirectory; } else { throw new Exception("Directory does not exist: $pDirectory"); } @@ -285,6 +285,6 @@ public function setUseDiskCaching($pValue = false, $pDirectory = null) */ public function getDiskCachingDirectory() { - return $this->_diskCachingDirectory; + return $this->diskCachingDirectory; } } diff --git a/Classes/PHPWord/Writer/ODText/Content.php b/Classes/PHPWord/Writer/ODText/Content.php index b788478e25..506ea903de 100755 --- a/Classes/PHPWord/Writer/ODText/Content.php +++ b/Classes/PHPWord/Writer/ODText/Content.php @@ -248,11 +248,11 @@ public function writeContent(PHPWord $pPHPWord = null) foreach ($_elements as $element) { if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); + $this->writeText($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); + $this->writeTextRun($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter); + $this->writeTextBreak($objWriter); } elseif ($element instanceof PHPWord_Section_Link) { $this->writeUnsupportedElement($objWriter, 'link'); } elseif ($element instanceof PHPWord_Section_Title) { @@ -276,9 +276,9 @@ public function writeContent(PHPWord $pPHPWord = null) } if ($pSection == $countSections) { - $this->_writeEndSection($objWriter, $section); + $this->writeEndSection($objWriter, $section); } else { - $this->_writeSection($objWriter, $section); + $this->writeSection($objWriter, $section); } } } @@ -297,8 +297,8 @@ public function writeContent(PHPWord $pPHPWord = null) * @param PHPWord_Section_Text $text * @param bool $withoutP */ - protected function _writeText( - PHPWord_Shared_XMLWriter $objWriter = null, + protected function writeText( + PHPWord_Shared_XMLWriter $objWriter, PHPWord_Section_Text $text, $withoutP = false ) { @@ -348,14 +348,16 @@ protected function _writeText( * @param PHPWord_Section_TextRun $textrun * @todo Enable all other section types */ - protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun) - { + protected function writeTextRun( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_TextRun $textrun + ) { $elements = $textrun->getElements(); $objWriter->startElement('text:p'); if (count($elements) > 0) { foreach ($elements as $element) { if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element, true); + $this->writeText($objWriter, $element, true); } } } @@ -365,14 +367,14 @@ protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHP /** * Write TextBreak */ - protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) + protected function writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) { $objWriter->startElement('text:p'); $objWriter->writeAttribute('text:style-name', 'Standard'); $objWriter->endElement(); } - private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null) + private function writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null) { } @@ -381,7 +383,7 @@ private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PH * * @todo Create the real function */ - private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null) + private function writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null) { } diff --git a/Classes/PHPWord/Writer/ODText/Manifest.php b/Classes/PHPWord/Writer/ODText/Manifest.php index 4b1c6b260a..5319224236 100755 --- a/Classes/PHPWord/Writer/ODText/Manifest.php +++ b/Classes/PHPWord/Writer/ODText/Manifest.php @@ -80,7 +80,7 @@ public function writeManifest(PHPWord $pPHPWord = null) for ($i = 0; $i < $this->getParentWriter()->getDrawingHashTable()->count(); ++$i) { if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPWord_Shape_Drawing) { $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension()); - $mimeType = $this->_getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath()); + $mimeType = $this->getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath()); $objWriter->startElement('manifest:file-entry'); $objWriter->writeAttribute('manifest:media-type', $mimeType); @@ -114,9 +114,9 @@ public function writeManifest(PHPWord $pPHPWord = null) * @return string Mime Type * @throws Exception */ - private function _getImageMimeType($pFile = '') + private function getImageMimeType($pFile = '') { - if (PHPWord_Shared_File::file_exists($pFile)) { + if (PHPWord_Shared_File::fileExists($pFile)) { $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } else { diff --git a/Classes/PHPWord/Writer/ODText/WriterPart.php b/Classes/PHPWord/Writer/ODText/WriterPart.php index 1e05cd5081..78bf92bf54 100755 --- a/Classes/PHPWord/Writer/ODText/WriterPart.php +++ b/Classes/PHPWord/Writer/ODText/WriterPart.php @@ -35,7 +35,7 @@ abstract class PHPWord_Writer_ODText_WriterPart * * @var PHPWord_Writer_IWriter */ - private $_parentWriter; + private $parentWriter; /** * Set parent IWriter object @@ -45,7 +45,7 @@ abstract class PHPWord_Writer_ODText_WriterPart */ public function setParentWriter(PHPWord_Writer_IWriter $pWriter = null) { - $this->_parentWriter = $pWriter; + $this->parentWriter = $pWriter; } /** @@ -56,8 +56,8 @@ public function setParentWriter(PHPWord_Writer_IWriter $pWriter = null) */ public function getParentWriter() { - if (!is_null($this->_parentWriter)) { - return $this->_parentWriter; + if (!is_null($this->parentWriter)) { + return $this->parentWriter; } else { throw new Exception("No parent PHPWord_Writer_IWriter assigned."); } diff --git a/Classes/PHPWord/Writer/RTF.php b/Classes/PHPWord/Writer/RTF.php index 9104c6fefb..2d0e33eaf3 100755 --- a/Classes/PHPWord/Writer/RTF.php +++ b/Classes/PHPWord/Writer/RTF.php @@ -35,18 +35,18 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter * * @var PHPWord */ - private $_document; + private $document; /** * Private unique PHPWord_Worksheet_BaseDrawing HashTable * * @var PHPWord_HashTable */ - private $_drawingHashTable; + private $drawingHashTable; - private $_colorTable; - private $_fontTable; - private $_lastParagraphStyle; + private $colorTable; + private $fontTable; + private $lastParagraphStyle; /** * Create a new PHPWord_Writer_ODText @@ -59,7 +59,7 @@ public function __construct(PHPWord $pPHPWord = null) $this->setPHPWord($pPHPWord); // Set HashTable variables - $this->_drawingHashTable = new PHPWord_HashTable(); + $this->drawingHashTable = new PHPWord_HashTable(); } /** @@ -70,7 +70,7 @@ public function __construct(PHPWord $pPHPWord = null) */ public function save($pFilename = null) { - if (!is_null($this->_document)) { + if (!is_null($this->document)) { // If $pFilename is php://output or php://stdout, make it a temporary file... $originalFilename = $pFilename; if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { @@ -105,8 +105,8 @@ public function save($pFilename = null) */ public function getPHPWord() { - if (!is_null($this->_document)) { - return $this->_document; + if (!is_null($this->document)) { + return $this->document; } else { throw new Exception("No PHPWord assigned."); } @@ -121,7 +121,7 @@ public function getPHPWord() */ public function setPHPWord(PHPWord $pPHPWord = null) { - $this->_document = $pPHPWord; + $this->document = $pPHPWord; return $this; } @@ -132,14 +132,14 @@ public function setPHPWord(PHPWord $pPHPWord = null) */ public function getDrawingHashTable() { - return $this->_drawingHashTable; + return $this->drawingHashTable; } private function getData() { - // PHPWord object : $this->_document - $this->_fontTable = $this->getDataFont(); - $this->_colorTable = $this->getDataColor(); + // PHPWord object : $this->document + $this->fontTable = $this->getDataFont(); + $this->colorTable = $this->getDataColor(); $sRTFContent = '{\rtf1'; // Set the default character set @@ -151,13 +151,13 @@ private function getData() $sRTFContent .= PHP_EOL; // Set the font tbl group $sRTFContent .= '{\fonttbl'; - foreach ($this->_fontTable as $idx => $font) { + foreach ($this->fontTable as $idx => $font) { $sRTFContent .= '{\f' . $idx . '\fnil\fcharset0 ' . $font . ';}'; } $sRTFContent .= '}' . PHP_EOL; // Set the color tbl group $sRTFContent .= '{\colortbl '; - foreach ($this->_colorTable as $idx => $color) { + foreach ($this->colorTable as $idx => $color) { $arrColor = PHPWord_Shared_Drawing::htmlToRGB($color); $sRTFContent .= ';\red' . $arrColor[0] . '\green' . $arrColor[1] . '\blue' . $arrColor[2] . ''; } @@ -190,12 +190,12 @@ private function getData() private function getDataFont() { - $pPHPWord = $this->_document; + $pPHPWord = $this->document; $arrFonts = array(); // Default font : PHPWord::DEFAULT_FONT_NAME $arrFonts[] = PHPWord::DEFAULT_FONT_NAME; - // PHPWord object : $this->_document + // PHPWord object : $this->document // Browse styles $styles = PHPWord_Style::getStyles(); @@ -240,10 +240,10 @@ private function getDataFont() private function getDataColor() { - $pPHPWord = $this->_document; + $pPHPWord = $this->document; $arrColors = array(); - // PHPWord object : $this->_document + // PHPWord object : $this->document // Browse styles $styles = PHPWord_Style::getStyles(); @@ -296,7 +296,7 @@ private function getDataColor() private function getDataContent() { - $pPHPWord = $this->_document; + $pPHPWord = $this->document; $sRTFBody = ''; $_sections = $pPHPWord->getSections(); @@ -360,7 +360,7 @@ private function getDataContentText(PHPWord_Section_Text $text, $withoutP = fals } if ($styleParagraph && !$withoutP) { - if ($this->_lastParagraphStyle != $text->getParagraphStyle()) { + if ($this->lastParagraphStyle != $text->getParagraphStyle()) { $sRTFText .= '\pard\nowidctlpar'; if ($styleParagraph->getSpaceAfter() != null) { $sRTFText .= '\sa' . $styleParagraph->getSpaceAfter(); @@ -370,17 +370,17 @@ private function getDataContentText(PHPWord_Section_Text $text, $withoutP = fals $sRTFText .= '\qc'; } } - $this->_lastParagraphStyle = $text->getParagraphStyle(); + $this->lastParagraphStyle = $text->getParagraphStyle(); } else { - $this->_lastParagraphStyle = ''; + $this->lastParagraphStyle = ''; } } else { - $this->_lastParagraphStyle = ''; + $this->lastParagraphStyle = ''; } if ($styleFont instanceof PHPWord_Style_Font) { if ($styleFont->getColor() != null) { - $idxColor = array_search($styleFont->getColor(), $this->_colorTable); + $idxColor = array_search($styleFont->getColor(), $this->colorTable); if ($idxColor !== false) { $sRTFText .= '\cf' . ($idxColor + 1); } @@ -388,7 +388,7 @@ private function getDataContentText(PHPWord_Section_Text $text, $withoutP = fals $sRTFText .= '\cf0'; } if ($styleFont->getName() != null) { - $idxFont = array_search($styleFont->getName(), $this->_fontTable); + $idxFont = array_search($styleFont->getName(), $this->fontTable); if ($idxFont !== false) { $sRTFText .= '\f' . $idxFont; } @@ -405,7 +405,7 @@ private function getDataContentText(PHPWord_Section_Text $text, $withoutP = fals $sRTFText .= '\fs' . ($styleFont->getSize() * 2); } } - if ($this->_lastParagraphStyle != '' || $styleFont) { + if ($this->lastParagraphStyle != '' || $styleFont) { $sRTFText .= ' '; } $sRTFText .= $text->getText(); @@ -454,7 +454,7 @@ private function getDataContentTextRun(PHPWord_Section_TextRun $textrun) private function getDataContentTextBreak() { - $this->_lastParagraphStyle = ''; + $this->lastParagraphStyle = ''; return '\par' . PHP_EOL; } diff --git a/Classes/PHPWord/Writer/Word2007.php b/Classes/PHPWord/Writer/Word2007.php index bd574eb202..bd64d6454f 100755 --- a/Classes/PHPWord/Writer/Word2007.php +++ b/Classes/PHPWord/Writer/Word2007.php @@ -34,38 +34,38 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter { - private $_document; - private $_writerParts; - private $_diskCachingDirectory; - private $_useDiskCaching = false; - private $_imageTypes = array(); - private $_objectTypes = array(); + private $document; + private $writerParts; + private $diskCachingDirectory; + private $useDiskCaching = false; + private $imageTypes = array(); + private $objectTypes = array(); public function __construct(PHPWord $PHPWord = null) { - $this->_document = $PHPWord; - - $this->_diskCachingDirectory = './'; - - $this->_writerParts['contenttypes'] = new PHPWord_Writer_Word2007_ContentTypes(); - $this->_writerParts['rels'] = new PHPWord_Writer_Word2007_Rels(); - $this->_writerParts['docprops'] = new PHPWord_Writer_Word2007_DocProps(); - $this->_writerParts['documentrels'] = new PHPWord_Writer_Word2007_DocumentRels(); - $this->_writerParts['document'] = new PHPWord_Writer_Word2007_Document(); - $this->_writerParts['styles'] = new PHPWord_Writer_Word2007_Styles(); - $this->_writerParts['header'] = new PHPWord_Writer_Word2007_Header(); - $this->_writerParts['footer'] = new PHPWord_Writer_Word2007_Footer(); - $this->_writerParts['footnotes'] = new PHPWord_Writer_Word2007_Footnotes(); - $this->_writerParts['footnotesrels'] = new PHPWord_Writer_Word2007_FootnotesRels(); - - foreach ($this->_writerParts as $writer) { + $this->document = $PHPWord; + + $this->diskCachingDirectory = './'; + + $this->writerParts['contenttypes'] = new PHPWord_Writer_Word2007_ContentTypes(); + $this->writerParts['rels'] = new PHPWord_Writer_Word2007_Rels(); + $this->writerParts['docprops'] = new PHPWord_Writer_Word2007_DocProps(); + $this->writerParts['documentrels'] = new PHPWord_Writer_Word2007_DocumentRels(); + $this->writerParts['document'] = new PHPWord_Writer_Word2007_Document(); + $this->writerParts['styles'] = new PHPWord_Writer_Word2007_Styles(); + $this->writerParts['header'] = new PHPWord_Writer_Word2007_Header(); + $this->writerParts['footer'] = new PHPWord_Writer_Word2007_Footer(); + $this->writerParts['footnotes'] = new PHPWord_Writer_Word2007_Footnotes(); + $this->writerParts['footnotesrels'] = new PHPWord_Writer_Word2007_FootnotesRels(); + + foreach ($this->writerParts as $writer) { $writer->setParentWriter($this); } } public function save($pFilename = null) { - if (!is_null($this->_document)) { + if (!is_null($this->document)) { // If $pFilename is php://output or php://stdout, make it a temporary file... $originalFilename = $pFilename; @@ -91,7 +91,7 @@ public function save($pFilename = null) $_secElements = PHPWord_Media::getSectionMediaElements(); foreach ($_secElements as $element) { // loop through section media elements if ($element['type'] != 'hyperlink') { - $this->_addFileToPackage($objZip, $element); + $this->addFileToPackage($objZip, $element); } $sectionElements[] = $element; } @@ -101,7 +101,7 @@ public function save($pFilename = null) if (count($_hdrMedia) > 0) { $objZip->addFromString('word/_rels/' . $_headerFile . '.xml.rels', $this->getWriterPart('documentrels')->writeHeaderFooterRels($_hdrMedia)); foreach ($_hdrMedia as $element) { // loop through header media elements - $this->_addFileToPackage($objZip, $element); + $this->addFileToPackage($objZip, $element); } } } @@ -111,7 +111,7 @@ public function save($pFilename = null) if (count($_ftrMedia) > 0) { $objZip->addFromString('word/_rels/' . $_footerFile . '.xml.rels', $this->getWriterPart('documentrels')->writeHeaderFooterRels($_ftrMedia)); foreach ($_ftrMedia as $element) { // loop through footers media elements - $this->_addFileToPackage($objZip, $element); + $this->addFileToPackage($objZip, $element); } } } @@ -126,7 +126,7 @@ public function save($pFilename = null) $_cHdrs = 0; $_cFtrs = 0; $rID = PHPWord_Media::countSectionMediaElements() + 6; - $_sections = $this->_document->getSections(); + $_sections = $this->document->getSections(); $footers = array(); foreach ($_sections as $section) { @@ -165,18 +165,18 @@ public function save($pFilename = null) $objZip->addFromString( '[Content_Types].xml', $this->getWriterPart('contenttypes')->writeContentTypes( - $this->_imageTypes, - $this->_objectTypes, + $this->imageTypes, + $this->objectTypes, $_cHdrs, $footers ) ); - $objZip->addFromString('_rels/.rels', $this->getWriterPart('rels')->writeRelationships($this->_document)); - $objZip->addFromString('docProps/app.xml', $this->getWriterPart('docprops')->writeDocPropsApp($this->_document)); - $objZip->addFromString('docProps/core.xml', $this->getWriterPart('docprops')->writeDocPropsCore($this->_document)); - $objZip->addFromString('word/document.xml', $this->getWriterPart('document')->writeDocument($this->_document)); + $objZip->addFromString('_rels/.rels', $this->getWriterPart('rels')->writeRelationships($this->document)); + $objZip->addFromString('docProps/app.xml', $this->getWriterPart('docprops')->writeDocPropsApp($this->document)); + $objZip->addFromString('docProps/core.xml', $this->getWriterPart('docprops')->writeDocPropsCore($this->document)); + $objZip->addFromString('word/document.xml', $this->getWriterPart('document')->writeDocument($this->document)); $objZip->addFromString('word/_rels/document.xml.rels', $this->getWriterPart('documentrels')->writeDocumentRels($sectionElements)); - $objZip->addFromString('word/styles.xml', $this->getWriterPart('styles')->writeStyles($this->_document)); + $objZip->addFromString('word/styles.xml', $this->getWriterPart('styles')->writeStyles($this->document)); // Write static files $objZip->addFile(PHPWORD_BASE_PATH . 'PHPWord/_staticDocParts/numbering.xml', 'word/numbering.xml'); @@ -233,20 +233,20 @@ private function checkContentTypes($src) if ($imageExtension === 'jpeg') { $imageExtension = 'jpg'; } - if (!in_array($imageType, $this->_imageTypes)) { - $this->_imageTypes[$imageExtension] = $imageType; + if (!in_array($imageType, $this->imageTypes)) { + $this->imageTypes[$imageExtension] = $imageType; } } else { - if (!in_array($extension, $this->_objectTypes)) { - $this->_objectTypes[] = $extension; + if (!in_array($extension, $this->objectTypes)) { + $this->objectTypes[] = $extension; } } } public function getWriterPart($pPartName = '') { - if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) { - return $this->_writerParts[strtolower($pPartName)]; + if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) { + return $this->writerParts[strtolower($pPartName)]; } else { return null; } @@ -254,16 +254,16 @@ public function getWriterPart($pPartName = '') public function getUseDiskCaching() { - return $this->_useDiskCaching; + return $this->useDiskCaching; } public function setUseDiskCaching($pValue = false, $pDirectory = null) { - $this->_useDiskCaching = $pValue; + $this->useDiskCaching = $pValue; if (!is_null($pDirectory)) { if (is_dir($pDirectory)) { - $this->_diskCachingDirectory = $pDirectory; + $this->diskCachingDirectory = $pDirectory; } else { throw new Exception("Directory does not exist: $pDirectory"); } @@ -272,7 +272,7 @@ public function setUseDiskCaching($pValue = false, $pDirectory = null) return $this; } - private function _addFileToPackage($objZip, $element) + private function addFileToPackage($objZip, $element) { if (isset($element['isMemImage']) && $element['isMemImage']) { $image = call_user_func($element['createfunction'], $element['source']); diff --git a/Classes/PHPWord/Writer/Word2007/Base.php b/Classes/PHPWord/Writer/Word2007/Base.php index 0168a64956..18ef99b1d3 100755 --- a/Classes/PHPWord/Writer/Word2007/Base.php +++ b/Classes/PHPWord/Writer/Word2007/Base.php @@ -31,12 +31,18 @@ */ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart { - /** * Write text + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Text $text + * @param bool $withoutP */ - protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Text $text, $withoutP = false) - { + protected function writeText( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_Text $text, + $withoutP = false + ) { $styleFont = $text->getFontStyle(); $SfIsObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false; @@ -48,7 +54,7 @@ protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWor $SpIsObject = ($styleParagraph instanceof PHPWord_Style_Paragraph) ? true : false; if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); + $this->writeParagraphStyle($objWriter, $styleParagraph); } elseif (!$SpIsObject && !is_null($styleParagraph)) { $objWriter->startElement('w:pPr'); $objWriter->startElement('w:pStyle'); @@ -59,12 +65,12 @@ protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWor } $strText = htmlspecialchars($text->getText()); - $strText = PHPWord_Shared_String::ControlCharacterPHP2OOXML($strText); + $strText = PHPWord_Shared_String::controlCharacterPHP2OOXML($strText); $objWriter->startElement('w:r'); if ($SfIsObject) { - $this->_writeTextStyle($objWriter, $styleFont); + $this->writeTextStyle($objWriter, $styleFont); } elseif (!$SfIsObject && !is_null($styleFont)) { $objWriter->startElement('w:rPr'); $objWriter->startElement('w:rStyle'); @@ -87,9 +93,14 @@ protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWor /** * Write text run + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_TextRun $textrun */ - protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun) - { + protected function writeTextRun( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_TextRun $textrun + ) { $elements = $textrun->getElements(); $styleParagraph = $textrun->getParagraphStyle(); @@ -98,7 +109,7 @@ protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHP $objWriter->startElement('w:p'); if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); + $this->writeParagraphStyle($objWriter, $styleParagraph); } elseif (!$SpIsObject && !is_null($styleParagraph)) { $objWriter->startElement('w:pPr'); $objWriter->startElement('w:pStyle'); @@ -110,13 +121,13 @@ protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHP if (count($elements) > 0) { foreach ($elements as $element) { if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element, true); + $this->writeText($objWriter, $element, true); } elseif ($element instanceof PHPWord_Section_Link) { - $this->_writeLink($objWriter, $element, true); + $this->writeLink($objWriter, $element, true); } elseif ($element instanceof PHPWord_Section_Image) { - $this->_writeImage($objWriter, $element, true); + $this->writeImage($objWriter, $element, true); } elseif ($element instanceof PHPWord_Section_Footnote) { - $this->_writeFootnoteReference($objWriter, $element, true); + $this->writeFootnoteReference($objWriter, $element, true); } elseif ($element instanceof PHPWord_Section_TextBreak) { $objWriter->writeElement('w:br'); } @@ -132,10 +143,9 @@ protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHP * @param PHPWord_Shared_XMLWriter $objWriter * @param PHPWord_Style_Paragraph $style * @param bool $withoutPPR - * @return void */ - protected function _writeParagraphStyle( - PHPWord_Shared_XMLWriter $objWriter = null, + protected function writeParagraphStyle( + PHPWord_Shared_XMLWriter $objWriter, PHPWord_Style_Paragraph $style, $withoutPPR = false ) { @@ -232,9 +242,16 @@ protected function _writeParagraphStyle( /** * Write link + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Style_Paragraph $style */ - protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Link $link, $withoutP = false) - { + protected function writeLink + ( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_Link $link, + $withoutP = false + ) { $rID = $link->getRelationId(); $linkName = $link->getLinkName(); if (is_null($linkName)) { @@ -251,7 +268,7 @@ protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWor $SpIsObject = ($styleParagraph instanceof PHPWord_Style_Paragraph) ? true : false; if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); + $this->writeParagraphStyle($objWriter, $styleParagraph); } elseif (!$SpIsObject && !is_null($styleParagraph)) { $objWriter->startElement('w:pPr'); $objWriter->startElement('w:pStyle'); @@ -267,7 +284,7 @@ protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWor $objWriter->startElement('w:r'); if ($SfIsObject) { - $this->_writeTextStyle($objWriter, $styleFont); + $this->writeTextStyle($objWriter, $styleFont); } elseif (!$SfIsObject && !is_null($styleFont)) { $objWriter->startElement('w:rPr'); $objWriter->startElement('w:rStyle'); @@ -291,9 +308,14 @@ protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWor /** * Write preserve text + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Footer_PreserveText $textrun */ - protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footer_PreserveText $textrun) - { + protected function writePreserveText( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_Footer_PreserveText $textrun + ) { $styleFont = $textrun->getFontStyle(); $styleParagraph = $textrun->getParagraphStyle(); @@ -308,7 +330,7 @@ protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null $objWriter->startElement('w:p'); if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); + $this->writeParagraphStyle($objWriter, $styleParagraph); } elseif (!$SpIsObject && !is_null($styleParagraph)) { $objWriter->startElement('w:pPr'); $objWriter->startElement('w:pStyle'); @@ -331,7 +353,7 @@ protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null $objWriter->startElement('w:r'); if ($SfIsObject) { - $this->_writeTextStyle($objWriter, $styleFont); + $this->writeTextStyle($objWriter, $styleFont); } elseif (!$SfIsObject && !is_null($styleFont)) { $objWriter->startElement('w:rPr'); $objWriter->startElement('w:rStyle'); @@ -359,12 +381,12 @@ protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null $objWriter->endElement(); } else { $text = htmlspecialchars($text); - $text = PHPWord_Shared_String::ControlCharacterPHP2OOXML($text); + $text = PHPWord_Shared_String::controlCharacterPHP2OOXML($text); $objWriter->startElement('w:r'); if ($SfIsObject) { - $this->_writeTextStyle($objWriter, $styleFont); + $this->writeTextStyle($objWriter, $styleFont); } elseif (!$SfIsObject && !is_null($styleFont)) { $objWriter->startElement('w:rPr'); $objWriter->startElement('w:rStyle'); @@ -386,9 +408,14 @@ protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null /** * Write text style + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Style_Font $style */ - protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Font $style) - { + protected function writeTextStyle( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Style_Font $style + ) { $font = $style->getName(); $bold = $style->getBold(); $italic = $style->getItalic(); @@ -477,17 +504,25 @@ protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, P /** * Write text break + * + * @param PHPWord_Shared_XMLWriter $objWriter */ - protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) - { + protected function writeTextBreak( + PHPWord_Shared_XMLWriter $objWriter = null + ) { $objWriter->writeElement('w:p', null); } /** * Write table + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Table $style */ - protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Table $table) - { + protected function writeTable( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_Table $table + ) { $_rows = $table->getRows(); $_cRows = count($_rows); @@ -496,7 +531,7 @@ protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo $tblStyle = $table->getStyle(); $tblWidth = $table->getWidth(); if ($tblStyle instanceof PHPWord_Style_Table) { - $this->_writeTableStyle($objWriter, $tblStyle); + $this->writeTableStyle($objWriter, $tblStyle); } else { if (!empty($tblStyle)) { $objWriter->startElement('w:tblPr'); @@ -555,7 +590,7 @@ protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo $objWriter->endElement(); if ($cellStyle instanceof PHPWord_Style_Cell) { - $this->_writeCellStyle($objWriter, $cellStyle); + $this->writeCellStyle($objWriter, $cellStyle); } $objWriter->endElement(); @@ -564,27 +599,27 @@ protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo if (count($_elements) > 0) { foreach ($_elements as $element) { if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); + $this->writeText($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); + $this->writeTextRun($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Link) { - $this->_writeLink($objWriter, $element); + $this->writeLink($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter); + $this->writeTextBreak($objWriter); } elseif ($element instanceof PHPWord_Section_ListItem) { - $this->_writeListItem($objWriter, $element); + $this->writeListItem($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Image || $element instanceof PHPWord_Section_MemoryImage ) { - $this->_writeImage($objWriter, $element); + $this->writeImage($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Object) { - $this->_writeObject($objWriter, $element); + $this->writeObject($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Footer_PreserveText) { - $this->_writePreserveText($objWriter, $element); + $this->writePreserveText($objWriter, $element); } } } else { - $this->_writeTextBreak($objWriter); + $this->writeTextBreak($objWriter); } $objWriter->endElement(); @@ -597,9 +632,14 @@ protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo /** * Write table style + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Style_Table $style */ - protected function _writeTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Table $style = null) - { + protected function writeTableStyle( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Style_Table $style + ) { $margins = $style->getCellMargin(); $mTop = (!is_null($margins[0])) ? true : false; $mLeft = (!is_null($margins[1])) ? true : false; @@ -645,9 +685,14 @@ protected function _writeTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, /** * Write cell style + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Style_Cell $style */ - protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Cell $style = null) - { + protected function writeCellStyle( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Style_Cell $style + ) { $bgColor = $style->getBgColor(); $valign = $style->getVAlign(); $textDir = $style->getTextDirection(); @@ -750,11 +795,15 @@ protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, P } /** - * @param \PHPWord_Shared_XMLWriter $objWriter - * @param \PHPWord_Section_Image|\PHPWord_Section_MemoryImage $image + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Image|PHPWord_Section_MemoryImage $image + * @param bool $withoutP */ - protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, $image, $withoutP = false) - { + protected function writeImage( + PHPWord_Shared_XMLWriter $objWriter, + $image, + $withoutP = false + ) { $rId = $image->getRelationId(); $style = $image->getStyle(); @@ -832,9 +881,15 @@ protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, $imag /** * Write watermark + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Image|PHPWord_Section_MemoryImage $image + * @param bool $withoutP */ - protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image) - { + protected function writeWatermark( + PHPWord_Shared_XMLWriter $objWriter, + $image + ) { $rId = $image->getRelationId(); $style = $image->getStyle(); @@ -879,11 +934,16 @@ protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $ /** * Write title + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Title $style */ - protected function _writeTitle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Title $title) - { + protected function writeTitle( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_Title $title + ) { $text = htmlspecialchars($title->getText()); - $text = PHPWord_Shared_String::ControlCharacterPHP2OOXML($text); + $text = PHPWord_Shared_String::controlCharacterPHP2OOXML($text); $anchor = $title->getAnchor(); $bookmarkId = $title->getBookmarkId(); $style = $title->getStyle(); @@ -924,9 +984,14 @@ protected function _writeTitle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo /** * Write footnote + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Footnote $style */ - protected function _writeFootnote(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footnote $footnote) - { + protected function writeFootnote( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_Footnote $footnote + ) { $objWriter->startElement('w:footnote'); $objWriter->writeAttribute('w:id', $footnote->getReferenceId()); @@ -936,7 +1001,7 @@ protected function _writeFootnote(PHPWord_Shared_XMLWriter $objWriter = null, PH $objWriter->startElement('w:p'); if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); + $this->writeParagraphStyle($objWriter, $styleParagraph); } elseif (!$SpIsObject && !is_null($styleParagraph)) { $objWriter->startElement('w:pPr'); $objWriter->startElement('w:pStyle'); @@ -949,9 +1014,9 @@ protected function _writeFootnote(PHPWord_Shared_XMLWriter $objWriter = null, PH if (count($elements) > 0) { foreach ($elements as $element) { if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element, true); + $this->writeText($objWriter, $element, true); } elseif ($element instanceof PHPWord_Section_Link) { - $this->_writeLink($objWriter, $element, true); + $this->writeLink($objWriter, $element, true); } } } @@ -962,9 +1027,16 @@ protected function _writeFootnote(PHPWord_Shared_XMLWriter $objWriter = null, PH /** * Write footnote reference + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Footnote $footnote + * @param bool $withoutP */ - protected function _writeFootnoteReference(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footnote $footnote, $withoutP = false) - { + protected function writeFootnoteReference( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_Footnote $footnote, + $withoutP = false + ) { if (!$withoutP) { $objWriter->startElement('w:p'); } diff --git a/Classes/PHPWord/Writer/Word2007/ContentTypes.php b/Classes/PHPWord/Writer/Word2007/ContentTypes.php index eeaeb84dba..1efd3be705 100755 --- a/Classes/PHPWord/Writer/Word2007/ContentTypes.php +++ b/Classes/PHPWord/Writer/Word2007/ContentTypes.php @@ -31,7 +31,7 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_WriterPart { - public function writeContentTypes($_imageTypes, $_objectTypes, $_cHdrs, $footers) + public function writeContentTypes($imageTypes, $objectTypes, $_cHdrs, $footers) { // Create XML writer $objWriter = null; @@ -49,27 +49,27 @@ public function writeContentTypes($_imageTypes, $_objectTypes, $_cHdrs, $footers $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types'); // Rels - $this->_writeDefaultContentType( + $this->writeDefaultContentType( $objWriter, 'rels', 'application/vnd.openxmlformats-package.relationships+xml' ); // XML - $this->_writeDefaultContentType( + $this->writeDefaultContentType( $objWriter, 'xml', 'application/xml' ); // Add media content-types - foreach ($_imageTypes as $key => $value) { - $this->_writeDefaultContentType($objWriter, $key, $value); + foreach ($imageTypes as $key => $value) { + $this->writeDefaultContentType($objWriter, $key, $value); } // Add embedding content-types - if (count($_objectTypes) > 0) { - $this->_writeDefaultContentType( + if (count($objectTypes) > 0) { + $this->writeDefaultContentType( $objWriter, 'bin', 'application/vnd.openxmlformats-officedocument.oleObject' @@ -77,76 +77,76 @@ public function writeContentTypes($_imageTypes, $_objectTypes, $_cHdrs, $footers } // DocProps - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/docProps/app.xml', 'application/vnd.openxmlformats-officedocument.extended-properties+xml' ); - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml' ); // Document - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/document.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml' ); // Styles - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/styles.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml' ); // Numbering - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/numbering.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml' ); // Settings - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/settings.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml' ); // Theme1 - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/theme/theme1.xml', 'application/vnd.openxmlformats-officedocument.theme+xml' ); // WebSettings - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/webSettings.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml' ); // Font Table - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/fontTable.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml' ); // Footnotes - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/footnotes.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml' ); for ($i = 1; $i <= $_cHdrs; $i++) { - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/header' . $i . '.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml' @@ -155,7 +155,7 @@ public function writeContentTypes($_imageTypes, $_objectTypes, $_cHdrs, $footers for ($i = 1; $i <= count($footers); $i++) { if (!is_null($footers[$i])) { - $this->_writeOverrideContentType( + $this->writeOverrideContentType( $objWriter, '/word/footer' . $i . '.xml', 'application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml' @@ -177,9 +177,9 @@ public function writeContentTypes($_imageTypes, $_objectTypes, $_cHdrs, $footers * @return string Mime Type * @throws Exception */ - private function _getImageMimeType($pFile = '') + private function getImageMimeType($pFile = '') { - if (PHPWord_Shared_File::file_exists($pFile)) { + if (PHPWord_Shared_File::fileExists($pFile)) { $image = getimagesize($pFile); return image_type_to_mime_type($image[2]); } else { @@ -195,7 +195,7 @@ private function _getImageMimeType($pFile = '') * @param string $pContentType Content type * @throws Exception */ - private function _writeDefaultContentType(PHPWord_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') + private function writeDefaultContentType(PHPWord_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { if ($pPartname != '' && $pContentType != '') { // Write content type @@ -216,7 +216,7 @@ private function _writeDefaultContentType(PHPWord_Shared_XMLWriter $objWriter = * @param string $pContentType Content type * @throws Exception */ - private function _writeOverrideContentType(PHPWord_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') + private function writeOverrideContentType(PHPWord_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { if ($pPartname != '' && $pContentType != '') { // Write content type diff --git a/Classes/PHPWord/Writer/Word2007/Document.php b/Classes/PHPWord/Writer/Word2007/Document.php index 558fa72fb7..9cc9065b0b 100755 --- a/Classes/PHPWord/Writer/Word2007/Document.php +++ b/Classes/PHPWord/Writer/Word2007/Document.php @@ -30,8 +30,12 @@ */ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base { - - public function writeDocument(PHPWord $pPHPWord = null) + /** + * Write document + * + * @param PHPWord $pPHPWord + */ + public function writeDocument(PHPWord $pPHPWord) { // Create XML writer @@ -71,38 +75,38 @@ public function writeDocument(PHPWord $pPHPWord = null) foreach ($_elements as $element) { if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); + $this->writeText($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); + $this->writeTextRun($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Link) { - $this->_writeLink($objWriter, $element); + $this->writeLink($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Title) { - $this->_writeTitle($objWriter, $element); + $this->writeTitle($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter); + $this->writeTextBreak($objWriter); } elseif ($element instanceof PHPWord_Section_PageBreak) { - $this->_writePageBreak($objWriter); + $this->writePageBreak($objWriter); } elseif ($element instanceof PHPWord_Section_Table) { - $this->_writeTable($objWriter, $element); + $this->writeTable($objWriter, $element); } elseif ($element instanceof PHPWord_Section_ListItem) { - $this->_writeListItem($objWriter, $element); + $this->writeListItem($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Image || $element instanceof PHPWord_Section_MemoryImage ) { - $this->_writeImage($objWriter, $element); + $this->writeImage($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Object) { - $this->_writeObject($objWriter, $element); + $this->writeObject($objWriter, $element); } elseif ($element instanceof PHPWord_TOC) { - $this->_writeTOC($objWriter); + $this->writeTOC($objWriter); } elseif ($element instanceof PHPWord_Section_Footnote) { - $this->_writeFootnoteReference($objWriter, $element); + $this->writeFootnoteReference($objWriter, $element); } } if ($pSection == $countSections) { - $this->_writeEndSection($objWriter, $section); + $this->writeEndSection($objWriter, $section); } else { - $this->_writeSection($objWriter, $section); + $this->writeSection($objWriter, $section); } } } @@ -114,17 +118,33 @@ public function writeDocument(PHPWord $pPHPWord = null) return $objWriter->getData(); } - private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section) - { + /** + * Write section + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section $section + */ + private function writeSection( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section $section + ) { $objWriter->startElement('w:p'); $objWriter->startElement('w:pPr'); - $this->_writeEndSection($objWriter, $section, 3); + $this->writeEndSection($objWriter, $section, 3); $objWriter->endElement(); $objWriter->endElement(); } - private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section) - { + /** + * Write end section + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section $section + */ + private function writeEndSection( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section $section + ) { $settings = $section->getSettings(); $_headers = $section->getHeaders(); $_footer = $section->getFooter(); @@ -256,8 +276,14 @@ private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PH $objWriter->endElement(); } - private function _writePageBreak(PHPWord_Shared_XMLWriter $objWriter = null) - { + /** + * Write page break + * + * @param PHPWord_Shared_XMLWriter $objWriter + */ + private function writePageBreak( + PHPWord_Shared_XMLWriter $objWriter + ) { $objWriter->startElement('w:p'); $objWriter->startElement('w:r'); $objWriter->startElement('w:br'); @@ -267,8 +293,16 @@ private function _writePageBreak(PHPWord_Shared_XMLWriter $objWriter = null) $objWriter->endElement(); } - public function _writeListItem(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_ListItem $listItem) - { + /** + * Write list item + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_ListItem $listItem + */ + public function writeListItem( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_ListItem $listItem + ) { $textObject = $listItem->getTextObject(); $text = $textObject->getText(); $styleParagraph = $textObject->getParagraphStyle(); @@ -281,7 +315,7 @@ public function _writeListItem(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo $objWriter->startElement('w:pPr'); if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph, true); + $this->writeParagraphStyle($objWriter, $styleParagraph, true); } elseif (!$SpIsObject && !is_null($styleParagraph)) { $objWriter->startElement('w:pStyle'); $objWriter->writeAttribute('w:val', $styleParagraph); @@ -301,13 +335,21 @@ public function _writeListItem(PHPWord_Shared_XMLWriter $objWriter = null, PHPWo $objWriter->endElement(); $objWriter->endElement(); - $this->_writeText($objWriter, $textObject, true); + $this->writeText($objWriter, $textObject, true); $objWriter->endElement(); } - protected function _writeObject(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Object $object) - { + /** + * Write object + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_Object $object + */ + protected function writeObject( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Section_Object $object + ) { $rIdObject = $object->getRelationId(); $rIdImage = $object->getImageRelationId(); $shapeId = md5($rIdObject . '_' . $rIdImage); @@ -365,7 +407,12 @@ protected function _writeObject(PHPWord_Shared_XMLWriter $objWriter = null, PHPW $objWriter->endElement(); // w:p } - private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null) + /** + * Write TOC + * + * @param PHPWord_Shared_XMLWriter $objWriter + */ + private function writeTOC(PHPWord_Shared_XMLWriter $objWriter = null) { $titles = PHPWord_TOC::getTitles(); $styleFont = PHPWord_TOC::getStyleFont(); @@ -386,7 +433,7 @@ private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null) $objWriter->startElement('w:pPr'); if ($isObject && !is_null($styleFont->getParagraphStyle())) { - $this->_writeParagraphStyle($objWriter, $styleFont->getParagraphStyle()); + $this->writeParagraphStyle($objWriter, $styleFont->getParagraphStyle()); } if ($indent > 0) { @@ -444,7 +491,7 @@ private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null) $objWriter->startElement('w:r'); if ($isObject) { - $this->_writeTextStyle($objWriter, $styleFont); + $this->writeTextStyle($objWriter, $styleFont); } $objWriter->startElement('w:t'); diff --git a/Classes/PHPWord/Writer/Word2007/DocumentRels.php b/Classes/PHPWord/Writer/Word2007/DocumentRels.php index e5aaffbd45..d2e27543e5 100755 --- a/Classes/PHPWord/Writer/Word2007/DocumentRels.php +++ b/Classes/PHPWord/Writer/Word2007/DocumentRels.php @@ -49,7 +49,7 @@ public function writeDocumentRels($_relsCollection) $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); // Relationship word/document.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, 1, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles', @@ -57,7 +57,7 @@ public function writeDocumentRels($_relsCollection) ); // Relationship word/numbering.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, 2, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering', @@ -65,7 +65,7 @@ public function writeDocumentRels($_relsCollection) ); // Relationship word/settings.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, 3, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings', @@ -73,7 +73,7 @@ public function writeDocumentRels($_relsCollection) ); // Relationship word/settings.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, 4, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme', @@ -81,7 +81,7 @@ public function writeDocumentRels($_relsCollection) ); // Relationship word/settings.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, 5, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings', @@ -89,7 +89,7 @@ public function writeDocumentRels($_relsCollection) ); // Relationship word/settings.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, 6, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable', @@ -103,7 +103,7 @@ public function writeDocumentRels($_relsCollection) $relationId = $relation['rID']; $targetMode = ($relationType == 'hyperlink') ? 'External' : ''; - $this->_writeRelationship( + $this->writeRelationship( $objWriter, $relationId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/' . $relationType, @@ -142,7 +142,7 @@ public function writeHeaderFooterRels($_relsCollection) $relationName = $relation['target']; $relationId = $relation['rID']; - $this->_writeRelationship( + $this->writeRelationship( $objWriter, $relationId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/' . $relationType, @@ -157,7 +157,7 @@ public function writeHeaderFooterRels($_relsCollection) return $objWriter->getData(); } - private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') + private function writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if ($pType != '' && $pTarget != '') { if (strpos($pId, 'rId') === false) { diff --git a/Classes/PHPWord/Writer/Word2007/Footer.php b/Classes/PHPWord/Writer/Word2007/Footer.php index 1cd49771cb..565649db00 100755 --- a/Classes/PHPWord/Writer/Word2007/Footer.php +++ b/Classes/PHPWord/Writer/Word2007/Footer.php @@ -59,19 +59,19 @@ public function writeFooter(PHPWord_Section_Footer $footer) foreach ($_elements as $element) { if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); + $this->writeText($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); + $this->writeTextRun($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter); + $this->writeTextBreak($objWriter); } elseif ($element instanceof PHPWord_Section_Table) { - $this->_writeTable($objWriter, $element); + $this->writeTable($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Image || $element instanceof PHPWord_Section_MemoryImage ) { - $this->_writeImage($objWriter, $element); + $this->writeImage($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Footer_PreserveText) { - $this->_writePreserveText($objWriter, $element); + $this->writePreserveText($objWriter, $element); } } diff --git a/Classes/PHPWord/Writer/Word2007/Footnotes.php b/Classes/PHPWord/Writer/Word2007/Footnotes.php index fe7ced0ed9..a130b2a7b9 100644 --- a/Classes/PHPWord/Writer/Word2007/Footnotes.php +++ b/Classes/PHPWord/Writer/Word2007/Footnotes.php @@ -71,7 +71,7 @@ public function writeFootnotes($allFootnotesCollection) foreach ($allFootnotesCollection as $footnote) { if ($footnote instanceof PHPWord_Section_Footnote) { - $this->_writeFootnote($objWriter, $footnote); + $this->writeFootnote($objWriter, $footnote); } } diff --git a/Classes/PHPWord/Writer/Word2007/FootnotesRels.php b/Classes/PHPWord/Writer/Word2007/FootnotesRels.php index 6c81b3c95e..2c093b16d2 100644 --- a/Classes/PHPWord/Writer/Word2007/FootnotesRels.php +++ b/Classes/PHPWord/Writer/Word2007/FootnotesRels.php @@ -52,7 +52,7 @@ public function writeFootnotesRels($_relsCollection) $relationId = $relation['rID']; $targetMode = ($relationType == 'hyperlink') ? 'External' : ''; - $this->_writeRelationship($objWriter, $relationId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/' . $relationType, $relationName, $targetMode); + $this->writeRelationship($objWriter, $relationId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/' . $relationType, $relationName, $targetMode); } $objWriter->endElement(); @@ -61,7 +61,7 @@ public function writeFootnotesRels($_relsCollection) return $objWriter->getData(); } - private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') + private function writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if ($pType != '' && $pTarget != '') { if (strpos($pId, 'rId') === false) { diff --git a/Classes/PHPWord/Writer/Word2007/Header.php b/Classes/PHPWord/Writer/Word2007/Header.php index 4106d197c3..8fcd3b7459 100755 --- a/Classes/PHPWord/Writer/Word2007/Header.php +++ b/Classes/PHPWord/Writer/Word2007/Header.php @@ -59,23 +59,23 @@ public function writeHeader(PHPWord_Section_Header $header) foreach ($_elements as $element) { if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); + $this->writeText($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); + $this->writeTextRun($objWriter, $element); } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter); + $this->writeTextBreak($objWriter); } elseif ($element instanceof PHPWord_Section_Table) { - $this->_writeTable($objWriter, $element); + $this->writeTable($objWriter, $element); } elseif ($element instanceof PHPWord_Section_Image || $element instanceof PHPWord_Section_MemoryImage ) { if (!$element->getIsWatermark()) { - $this->_writeImage($objWriter, $element); + $this->writeImage($objWriter, $element); } else { - $this->_writeWatermark($objWriter, $element); + $this->writeWatermark($objWriter, $element); } } elseif ($element instanceof PHPWord_Section_Footer_PreserveText) { - $this->_writePreserveText($objWriter, $element); + $this->writePreserveText($objWriter, $element); } } diff --git a/Classes/PHPWord/Writer/Word2007/Rels.php b/Classes/PHPWord/Writer/Word2007/Rels.php index 97f28d2225..dda16782c0 100755 --- a/Classes/PHPWord/Writer/Word2007/Rels.php +++ b/Classes/PHPWord/Writer/Word2007/Rels.php @@ -51,7 +51,7 @@ public function writeRelationships(PHPWord $pPHPWord = null) $relationId = 1; // Relationship word/document.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, $relationId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument', @@ -59,7 +59,7 @@ public function writeRelationships(PHPWord $pPHPWord = null) ); // Relationship docProps/core.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, ++$relationId, 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties', @@ -67,7 +67,7 @@ public function writeRelationships(PHPWord $pPHPWord = null) ); // Relationship docProps/app.xml - $this->_writeRelationship( + $this->writeRelationship( $objWriter, ++$relationId, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties', @@ -90,7 +90,7 @@ public function writeRelationships(PHPWord $pPHPWord = null) * @param string $pTargetMode Relationship target mode * @throws Exception */ - private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') + private function writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if ($pType != '' && $pTarget != '') { if (strpos($pId, 'rId') === false) { diff --git a/Classes/PHPWord/Writer/Word2007/Styles.php b/Classes/PHPWord/Writer/Word2007/Styles.php index c87d94bfa2..0fb8a40fa7 100755 --- a/Classes/PHPWord/Writer/Word2007/Styles.php +++ b/Classes/PHPWord/Writer/Word2007/Styles.php @@ -30,10 +30,19 @@ */ class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base { - - private $_document; - - public function writeStyles(PHPWord $pPHPWord = null) + /** + * PHPWord object + * + * @var PHPWord + */ + private $document; + + /** + * Write styles + * + * @param PHPWord $pPHPWord + */ + public function writeStyles(PHPWord $pPHPWord) { // Create XML writer $objWriter = null; @@ -43,7 +52,7 @@ public function writeStyles(PHPWord $pPHPWord = null) $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); } - $this->_document = $pPHPWord; + $this->document = $pPHPWord; // XML header $objWriter->startDocument('1.0', 'UTF-8', 'yes'); @@ -54,7 +63,7 @@ public function writeStyles(PHPWord $pPHPWord = null) $objWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); // Write DocDefaults - $this->_writeDocDefaults($objWriter); + $this->writeDocDefaults($objWriter); // Write Style Definitions @@ -73,7 +82,7 @@ public function writeStyles(PHPWord $pPHPWord = null) $objWriter->writeAttribute('w:val', 'Normal'); $objWriter->endElement(); if (!is_null($normalStyle)) { - $this->_writeParagraphStyle($objWriter, $normalStyle); + $this->writeParagraphStyle($objWriter, $normalStyle); } $objWriter->endElement(); @@ -118,10 +127,10 @@ public function writeStyles(PHPWord $pPHPWord = null) $objWriter->startElement('w:basedOn'); $objWriter->writeAttribute('w:val', 'Normal'); $objWriter->endElement(); - $this->_writeParagraphStyle($objWriter, $paragraphStyle); + $this->writeParagraphStyle($objWriter, $paragraphStyle); } - $this->_writeTextStyle($objWriter, $style); + $this->writeTextStyle($objWriter, $style); $objWriter->endElement(); @@ -151,7 +160,7 @@ public function writeStyles(PHPWord $pPHPWord = null) $objWriter->endElement(); } - $this->_writeParagraphStyle($objWriter, $style); + $this->writeParagraphStyle($objWriter, $style); $objWriter->endElement(); } elseif ($style instanceof PHPWord_Style_TableFull) { @@ -168,7 +177,7 @@ public function writeStyles(PHPWord $pPHPWord = null) $objWriter->writeAttribute('w:val', '99'); $objWriter->endElement(); - $this->_writeFullTableStyle($objWriter, $style); + $this->writeTableFullStyle($objWriter, $style); $objWriter->endElement(); } @@ -181,9 +190,16 @@ public function writeStyles(PHPWord $pPHPWord = null) return $objWriter->getData(); } - private function _writeFullTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_TableFull $style) - { - + /** + * Write full table style + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Style_TableFull $style + */ + private function writeTableFullStyle( + PHPWord_Shared_XMLWriter $objWriter, + PHPWord_Style_TableFull $style + ) { $brdSz = $style->getBorderSize(); $brdCol = $style->getBorderColor(); $bgColor = $style->getBgColor(); @@ -298,12 +314,22 @@ private function _writeFullTableStyle(PHPWord_Shared_XMLWriter $objWriter = null // First Row $firstRow = $style->getFirstRow(); if (!is_null($firstRow)) { - $this->_writeRowStyle($objWriter, 'firstRow', $firstRow); + $this->writeTableFirstRowStyle($objWriter, 'firstRow', $firstRow); } } - private function _writeRowStyle(PHPWord_Shared_XMLWriter $objWriter = null, $type, PHPWord_Style_TableFull $style) - { + /** + * Write row style for the first row + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param string $type + * @param PHPWord_Style_TableFull $style + */ + private function writeTableFirstRowStyle( + PHPWord_Shared_XMLWriter $objWriter, + $type, + PHPWord_Style_TableFull $style + ) { $brdSz = $style->getBorderSize(); $brdCol = $style->getBorderColor(); $bgColor = $style->getBgColor(); @@ -363,10 +389,15 @@ private function _writeRowStyle(PHPWord_Shared_XMLWriter $objWriter = null, $typ } - private function _writeDocDefaults(PHPWord_Shared_XMLWriter $objWriter = null) + /** + * Write document defaults + * + * @param PHPWord_Shared_XMLWriter $objWriter + */ + private function writeDocDefaults(PHPWord_Shared_XMLWriter $objWriter) { - $fontName = $this->_document->getDefaultFontName(); - $fontSize = $this->_document->getDefaultFontSize(); + $fontName = $this->document->getDefaultFontName(); + $fontSize = $this->document->getDefaultFontSize(); $objWriter->startElement('w:docDefaults'); $objWriter->startElement('w:rPrDefault'); diff --git a/Classes/PHPWord/Writer/Word2007/WriterPart.php b/Classes/PHPWord/Writer/Word2007/WriterPart.php index 91a863e01b..e9c37bea34 100755 --- a/Classes/PHPWord/Writer/Word2007/WriterPart.php +++ b/Classes/PHPWord/Writer/Word2007/WriterPart.php @@ -30,17 +30,17 @@ */ abstract class PHPWord_Writer_Word2007_WriterPart { - private $_parentWriter; + private $parentWriter; public function setParentWriter(PHPWord_Writer_IWriter $pWriter = null) { - $this->_parentWriter = $pWriter; + $this->parentWriter = $pWriter; } public function getParentWriter() { - if (!is_null($this->_parentWriter)) { - return $this->_parentWriter; + if (!is_null($this->parentWriter)) { + return $this->parentWriter; } else { throw new Exception("No parent PHPWord_Writer_IWriter assigned."); } diff --git a/Tests/PHPWord/Shared/FileTest.php b/Tests/PHPWord/Shared/FileTest.php index 89aa78ccd5..17fee11828 100644 --- a/Tests/PHPWord/Shared/FileTest.php +++ b/Tests/PHPWord/Shared/FileTest.php @@ -12,7 +12,7 @@ class FileTest extends \PHPUnit_Framework_TestCase { /** - * Test file_exists() + * covers ::fileExists */ public function testFileExists() { @@ -21,7 +21,7 @@ public function testFileExists() array(PHPWORD_TESTS_DIR_ROOT, '_files', 'templates') ); chdir($dir); - $this->assertTrue(PHPWord_Shared_File::file_exists('blank.docx')); + $this->assertTrue(PHPWord_Shared_File::fileExists('blank.docx')); } /** diff --git a/Tests/PHPWord/Shared/StringTest.php b/Tests/PHPWord/Shared/StringTest.php index 41bd6d59a4..89f6b0b739 100644 --- a/Tests/PHPWord/Shared/StringTest.php +++ b/Tests/PHPWord/Shared/StringTest.php @@ -36,7 +36,7 @@ public function testGetIsMbstringAndIconvEnabled() public function testFormatNumber() { $expected = '1022.12'; - $returned = PHPWord_Shared_String::FormatNumber('1022.1234'); + $returned = PHPWord_Shared_String::formatNumber('1022.1234'); $this->assertEquals($expected, $returned); } } diff --git a/Tests/PHPWord/Writer/Word2007/BaseTest.php b/Tests/PHPWord/Writer/Word2007/BaseTest.php index 6aafce9313..639ddf67d3 100644 --- a/Tests/PHPWord/Writer/Word2007/BaseTest.php +++ b/Tests/PHPWord/Writer/Word2007/BaseTest.php @@ -22,7 +22,7 @@ public function tearDown() } /** - * covers ::_writeText + * covers ::writeText */ public function testWriteText() { @@ -43,7 +43,7 @@ public function testWriteText() } /** - * covers ::_writeTextRun + * covers ::writeTextRun */ public function testWriteTextRun() { @@ -70,7 +70,7 @@ public function testWriteTextRun() } /** - * covers ::_writeLink + * covers ::writeLink */ public function testWriteLink() { @@ -87,7 +87,7 @@ public function testWriteLink() } /** - * covers ::_writePreserveText + * covers ::writePreserveText */ public function testWritePreserveText() { @@ -105,7 +105,7 @@ public function testWritePreserveText() } /** - * covers ::_writeParagraphStyle + * covers ::writeParagraphStyle */ public function testWriteParagraphStyleAlign() { @@ -121,7 +121,7 @@ public function testWriteParagraphStyleAlign() } /** - * covers ::_writeParagraphStyle + * covers ::writeParagraphStyle */ public function testWriteParagraphStylePagination() { @@ -151,7 +151,7 @@ public function testWriteParagraphStylePagination() } /** - * covers ::_writeTextStyle + * covers ::writeTextStyle */ public function testWriteFontStyle() { @@ -183,7 +183,7 @@ public function testWriteFontStyle() } /** - * covers ::_writeTableStyle + * covers ::writeTableStyle */ public function testWriteTableStyle() { @@ -241,7 +241,7 @@ public function testWriteTableStyle() } /** - * covers ::_writeCellStyle + * covers ::writeCellStyle */ public function testWriteCellStyleCellGridSpan() { @@ -268,7 +268,7 @@ public function testWriteCellStyleCellGridSpan() } /** - * covers ::_writeImage + * covers ::writeImage */ public function testWriteImagePosition() { @@ -293,7 +293,7 @@ public function testWriteImagePosition() } /** - * covers ::_writeWatermark + * covers ::writeWatermark */ public function testWriteWatermark() { @@ -313,7 +313,7 @@ public function testWriteWatermark() } /** - * covers ::_writeTitle + * covers ::writeTitle */ public function testWriteTitle() { diff --git a/Tests/PHPWord/Writer/Word2007/DocumentTest.php b/Tests/PHPWord/Writer/Word2007/DocumentTest.php index fe854feebe..b2ee5cde24 100644 --- a/Tests/PHPWord/Writer/Word2007/DocumentTest.php +++ b/Tests/PHPWord/Writer/Word2007/DocumentTest.php @@ -34,11 +34,11 @@ public function testWriteEndSectionPageNumbering() } /** - * covers ::_writeTOC - * covers ::_writePageBreak - * covers ::_writeListItem - * covers ::_writeTitle - * covers ::_writeObject + * covers ::writeTOC + * covers ::writePageBreak + * covers ::writeListItem + * covers ::writeTitle + * covers ::writeObject */ public function testElements() {