diff --git a/Classes/PHPWord.php b/Classes/PHPWord.php index d591b94e..e7501d85 100755 --- a/Classes/PHPWord.php +++ b/Classes/PHPWord.php @@ -188,8 +188,8 @@ class PHPWord /** * Adds a paragraph style definition to styles.xml * - * @param $styleName string - * @param $styles array + * @param string $styleName + * @param array $styles */ public function addParagraphStyle($styleName, $styles) { @@ -199,8 +199,9 @@ class PHPWord /** * Adds a font style definition to styles.xml * - * @param $styleName string - * @param $styles array + * @param string $styleName + * @param array $styleFont + * @param array $styleParagraph */ public function addFontStyle($styleName, $styleFont, $styleParagraph = null) { @@ -210,8 +211,9 @@ class PHPWord /** * Adds a table style definition to styles.xml * - * @param $styleName string - * @param $styles array + * @param string $styleName + * @param array $styleTable + * @param array $styleFirstRow */ public function addTableStyle($styleName, $styleTable, $styleFirstRow = null) { @@ -221,8 +223,9 @@ class PHPWord /** * Adds a heading style definition to styles.xml * - * @param $titleCount int - * @param $styles array + * @param int $titleCount + * @param array $styleFont + * @param array $styleParagraph */ public function addTitleStyle($titleCount, $styleFont, $styleParagraph = null) { @@ -232,8 +235,8 @@ class PHPWord /** * Adds a hyperlink style to styles.xml * - * @param $styleName string - * @param $styles array + * @param string $styleName + * @param array $styles */ public function addLinkStyle($styleName, $styles) { diff --git a/Classes/PHPWord/Autoloader.php b/Classes/PHPWord/Autoloader.php index aa36efc8..6a915563 100755 --- a/Classes/PHPWord/Autoloader.php +++ b/Classes/PHPWord/Autoloader.php @@ -69,7 +69,7 @@ class PHPWord_Autoloader /** * Autoloader * - * @param string + * @param string $class */ public static function autoload($class) { diff --git a/Classes/PHPWord/Exceptions/Exception.php b/Classes/PHPWord/Exceptions/Exception.php index 11cb0516..d00ed0a9 100755 --- a/Classes/PHPWord/Exceptions/Exception.php +++ b/Classes/PHPWord/Exceptions/Exception.php @@ -1,4 +1,29 @@ _valign; } + /** + * Set vertical align + * + * @param string $pValue + */ public function setVAlign($pValue = null) { $this->_valign = $pValue; } + /** + * Get text direction + */ public function getTextDirection() { return $this->_textDirection; } + /** + * Set text direction + * + * @param string $pValue + */ public function setTextDirection($pValue = null) { $this->_textDirection = $pValue; } + /** + * Get background color + */ public function getBgColor() { return $this->_bgColor; } + /** + * Set background color + * + * @param string $pValue + */ public function setBgColor($pValue = null) { $this->_bgColor = $pValue; } + /** + * Set border size + * + * @param int $pValue + */ public function setBorderSize($pValue = null) { $this->_borderTopSize = $pValue; @@ -209,6 +238,9 @@ class PHPWord_Style_Cell $this->_borderBottomSize = $pValue; } + /** + * Get border size + */ public function getBorderSize() { $t = $this->getBorderTopSize(); @@ -219,6 +251,11 @@ class PHPWord_Style_Cell return array($t, $l, $r, $b); } + /** + * Set border color + * + * @param string $pValue + */ public function setBorderColor($pValue = null) { $this->_borderTopColor = $pValue; @@ -227,6 +264,9 @@ class PHPWord_Style_Cell $this->_borderBottomColor = $pValue; } + /** + * Get border color + */ public function getBorderColor() { $t = $this->getBorderTopColor(); @@ -237,107 +277,189 @@ class PHPWord_Style_Cell return array($t, $l, $r, $b); } + /** + * Set border top size + * + * @param int $pValue + */ public function setBorderTopSize($pValue = null) { $this->_borderTopSize = $pValue; } + /** + * Get border top size + */ public function getBorderTopSize() { return $this->_borderTopSize; } + /** + * Set border top color + * + * @param string $pValue + */ public function setBorderTopColor($pValue = null) { $this->_borderTopColor = $pValue; } + /** + * Get border top color + */ public function getBorderTopColor() { return $this->_borderTopColor; } + /** + * Set border left size + * + * @param int $pValue + */ public function setBorderLeftSize($pValue = null) { $this->_borderLeftSize = $pValue; } + /** + * Get border left size + */ public function getBorderLeftSize() { return $this->_borderLeftSize; } + /** + * Set border left color + * + * @param string $pValue + */ public function setBorderLeftColor($pValue = null) { $this->_borderLeftColor = $pValue; } + /** + * Get border left color + */ public function getBorderLeftColor() { return $this->_borderLeftColor; } + /** + * Set border right size + * + * @param int $pValue + */ public function setBorderRightSize($pValue = null) { $this->_borderRightSize = $pValue; } + /** + * Get border right size + */ public function getBorderRightSize() { return $this->_borderRightSize; } + /** + * Set border right color + * + * @param string $pValue + */ public function setBorderRightColor($pValue = null) { $this->_borderRightColor = $pValue; } + /** + * Get border right color + */ public function getBorderRightColor() { return $this->_borderRightColor; } - + /** + * Set border bottom size + * + * @param int $pValue + */ public function setBorderBottomSize($pValue = null) { $this->_borderBottomSize = $pValue; } + /** + * Get border bottom size + */ public function getBorderBottomSize() { return $this->_borderBottomSize; } + /** + * Set border bottom color + * + * @param string $pValue + */ public function setBorderBottomColor($pValue = null) { $this->_borderBottomColor = $pValue; } + /** + * Get border bottom color + */ public function getBorderBottomColor() { return $this->_borderBottomColor; } + /** + * Get default border color + */ public function getDefaultBorderColor() { return $this->_defaultBorderColor; } + /** + * Set grid span (colspan) + * + * @param int $pValue + */ public function setGridSpan($pValue = null) { $this->_gridSpan = $pValue; } + /** + * Get grid span (colspan) + */ public function getGridSpan() { return $this->_gridSpan; } + /** + * Set vertical merge (rowspan) + * + * @param string $pValue + */ public function setVMerge($pValue = null) { $this->_vMerge = $pValue; } + /** + * Get vertical merge (rowspan) + */ public function getVMerge() { return $this->_vMerge; diff --git a/Classes/PHPWord/Style/Font.php b/Classes/PHPWord/Style/Font.php index f26f3924..2aa6cbc6 100755 --- a/Classes/PHPWord/Style/Font.php +++ b/Classes/PHPWord/Style/Font.php @@ -185,6 +185,8 @@ class PHPWord_Style_Font } /** + * Set style using associative array + * * @param array $style * @return $this */ @@ -510,6 +512,8 @@ class PHPWord_Style_Font } /** + * Get line height + * * @return int|float */ public function getLineHeight() diff --git a/Classes/PHPWord/Style/Image.php b/Classes/PHPWord/Style/Image.php index 9bec4d5b..a6a128c9 100755 --- a/Classes/PHPWord/Style/Image.php +++ b/Classes/PHPWord/Style/Image.php @@ -36,9 +36,32 @@ class PHPWord_Style_Image const WRAPPING_STYLE_BEHIND = 'behind'; const WRAPPING_STYLE_INFRONT = 'infront'; + /** + * Image width + * + * @var int + */ private $_width; + + /** + * Image width + * + * @var int + */ private $_height; + + /** + * Alignment + * + * @var string + */ private $_align; + + /** + * Wrapping style + * + * @var string + */ private $wrappingStyle; /** @@ -55,6 +78,9 @@ class PHPWord_Style_Image */ private $_marginLeft; + /** + * Constructor + */ public function __construct() { $this->_width = null; @@ -65,36 +91,66 @@ class PHPWord_Style_Image $this->setWrappingStyle(self::WRAPPING_STYLE_INLINE); } + /** + * Set style value + * + * @param string $key + * @param mixed $value + */ public function setStyleValue($key, $value) { $this->$key = $value; } + /** + * Get width + */ public function getWidth() { return $this->_width; } + /** + * Set width + * + * @param int $pValue + */ public function setWidth($pValue = null) { $this->_width = $pValue; } + /** + * Get height + */ public function getHeight() { return $this->_height; } + /** + * Set height + * + * @param int $pValue + */ public function setHeight($pValue = null) { $this->_height = $pValue; } + /** + * Get alignment + */ public function getAlign() { return $this->_align; } + /** + * Set alignment + * + * @param string $pValue + */ public function setAlign($pValue = null) { $this->_align = $pValue; @@ -145,6 +201,8 @@ class PHPWord_Style_Image } /** + * Set wrapping style + * * @param string $wrappingStyle * @throws InvalidArgumentException * @return $this @@ -167,6 +225,8 @@ class PHPWord_Style_Image } /** + * Get wrapping style + * * @return string */ public function getWrappingStyle() diff --git a/Classes/PHPWord/Style/Paragraph.php b/Classes/PHPWord/Style/Paragraph.php index 32a44929..14e1f8e0 100755 --- a/Classes/PHPWord/Style/Paragraph.php +++ b/Classes/PHPWord/Style/Paragraph.php @@ -133,6 +133,8 @@ class PHPWord_Style_Paragraph private $_pageBreakBefore = false; /** + * Set style using associative array + * * @param array $style * @return $this */ @@ -319,11 +321,11 @@ class PHPWord_Style_Paragraph return $this->_tabs; } - /* + /** * Set tabs * - * @param array $pValue - * @return PHPWord_Style_Paragraph + * @param array $pValue + * @return PHPWord_Style_Paragraph */ public function setTabs($pValue = null) { @@ -500,6 +502,8 @@ class PHPWord_Style_Paragraph } /** + * Get line height + * * @return int|float */ public function getLineHeight() diff --git a/Classes/PHPWord/Style/Row.php b/Classes/PHPWord/Style/Row.php index 93b5f862..da039d84 100644 --- a/Classes/PHPWord/Style/Row.php +++ b/Classes/PHPWord/Style/Row.php @@ -54,12 +54,21 @@ class PHPWord_Style_Row /** * Set style value + * + * @param string $key + * @param mixed $value */ public function setStyleValue($key, $value) { $this->$key = $value; } + /** + * Set tblHeader + * + * @param boolean $pValue + * @return PHPWord_Style_Row + */ public function setTblHeader($pValue = false) { if (!is_bool($pValue)) { @@ -69,11 +78,22 @@ class PHPWord_Style_Row return $this; } + /** + * Get tblHeader + * + * @return boolean + */ public function getTblHeader() { return $this->_tblHeader; } + /** + * Set cantSplit + * + * @param boolean $pValue + * @return PHPWord_Style_Row + */ public function setCantSplit($pValue = false) { if (!is_bool($pValue)) { @@ -83,6 +103,11 @@ class PHPWord_Style_Row return $this; } + /** + * Get cantSplit + * + * @return boolean + */ public function getCantSplit() { return $this->_cantSplit; diff --git a/Classes/PHPWord/Style/Table.php b/Classes/PHPWord/Style/Table.php index c3ef2e01..223e31c2 100755 --- a/Classes/PHPWord/Style/Table.php +++ b/Classes/PHPWord/Style/Table.php @@ -30,12 +30,37 @@ */ class PHPWord_Style_Table { - + /** + * Cell margin top + * + * @var int + */ private $_cellMarginTop; + + /** + * Cell margin left + * + * @var int + */ private $_cellMarginLeft; + + /** + * Cell margin right + * + * @var int + */ private $_cellMarginRight; + + /** + * Cell margin bottom + * + * @var int + */ private $_cellMarginBottom; + /** + * Constructor + */ public function __construct() { $this->_cellMarginTop = null; @@ -44,51 +69,92 @@ class PHPWord_Style_Table $this->_cellMarginBottom = null; } + /** + * Set style value + * + * @param string $key + * @param mixed $value + */ public function setStyleValue($key, $value) { $this->$key = $value; } + /** + * Set cell margin top + * + * @param int $pValue + */ public function setCellMarginTop($pValue = null) { $this->_cellMarginTop = $pValue; } + /** + * Get cell margin top + */ public function getCellMarginTop() { return $this->_cellMarginTop; } + /** + * Set cell margin left + * + * @param int $pValue + */ public function setCellMarginLeft($pValue = null) { $this->_cellMarginLeft = $pValue; } + /** + * Get cell margin left + */ public function getCellMarginLeft() { return $this->_cellMarginLeft; } + /** + * Set cell margin right + * + * @param int $pValue + */ public function setCellMarginRight($pValue = null) { $this->_cellMarginRight = $pValue; } + /** + * Get cell margin right + */ public function getCellMarginRight() { return $this->_cellMarginRight; } + /** + * Set cell margin bottom + * + * @param int $pValue + */ public function setCellMarginBottom($pValue = null) { $this->_cellMarginBottom = $pValue; } + /** + * Get cell margin bottom + */ public function getCellMarginBottom() { return $this->_cellMarginBottom; } + /** + * Get cell margin + */ public function getCellMargin() { return array($this->_cellMarginTop, $this->_cellMarginLeft, $this->_cellMarginRight, $this->_cellMarginBottom); diff --git a/Classes/PHPWord/Style/TableFull.php b/Classes/PHPWord/Style/TableFull.php index 573ae53b..8d145366 100755 --- a/Classes/PHPWord/Style/TableFull.php +++ b/Classes/PHPWord/Style/TableFull.php @@ -30,7 +30,6 @@ */ class PHPWord_Style_TableFull { - /** * Style for first row * @@ -160,6 +159,10 @@ class PHPWord_Style_TableFull /** * Create a new TableFull Font + * + * @param null|array $styleTable + * @param null|array $styleFirstRow + * @param null|array $styleLastRow */ public function __construct($styleTable = null, $styleFirstRow = null, $styleLastRow = null) { @@ -234,11 +237,19 @@ class PHPWord_Style_TableFull return $this->_lastRow; } + /** + * Get background color + */ public function getBgColor() { return $this->_bgColor; } + /** + * Set background color + * + * @param string $pValue + */ public function setBgColor($pValue = null) { $this->_bgColor = $pValue; @@ -247,7 +258,7 @@ class PHPWord_Style_TableFull /** * Set TLRBVH Border Size * - * @param int $pValue Border size in eighths of a point (1/8 point) + * @param int $pValue Border size in eighths of a point (1/8 point) */ public function setBorderSize($pValue = null) { @@ -278,6 +289,8 @@ class PHPWord_Style_TableFull /** * Set TLRBVH Border Color + * + * @param string $pValue */ public function setBorderColor($pValue = null) { @@ -306,161 +319,293 @@ class PHPWord_Style_TableFull return array($t, $l, $r, $b, $h, $v); } + /** + * Set border top size + * + * @param int $pValue + */ public function setBorderTopSize($pValue = null) { $this->_borderTopSize = $pValue; } + /** + * Get border top size + */ public function getBorderTopSize() { return $this->_borderTopSize; } + /** + * Set border top color + * + * @param string $pValue + */ public function setBorderTopColor($pValue = null) { $this->_borderTopColor = $pValue; } + /** + * Get border top color + */ public function getBorderTopColor() { return $this->_borderTopColor; } + /** + * Set border left size + * + * @param int $pValue + */ public function setBorderLeftSize($pValue = null) { $this->_borderLeftSize = $pValue; } + /** + * Get border left size + */ public function getBorderLeftSize() { return $this->_borderLeftSize; } + /** + * Set border left color + * + * @param string $pValue + */ public function setBorderLeftColor($pValue = null) { $this->_borderLeftColor = $pValue; } + /** + * Get border left color + */ public function getBorderLeftColor() { return $this->_borderLeftColor; } + /** + * Set border right size + * + * @param int $pValue + */ public function setBorderRightSize($pValue = null) { $this->_borderRightSize = $pValue; } + /** + * Get border right size + * + * @param int $pValue + */ public function getBorderRightSize() { return $this->_borderRightSize; } + /** + * Set border right color + * + * @param string $pValue + */ public function setBorderRightColor($pValue = null) { $this->_borderRightColor = $pValue; } + /** + * Get border right color + */ public function getBorderRightColor() { return $this->_borderRightColor; } + /** + * Set border bottom size + * + * + * @param string $pValue + * @param int $pValue + */ public function setBorderBottomSize($pValue = null) { $this->_borderBottomSize = $pValue; } + /** + * Get border bottom size + */ public function getBorderBottomSize() { return $this->_borderBottomSize; } + /** + * Set border bottom color + * + * @param string $pValue + */ public function setBorderBottomColor($pValue = null) { $this->_borderBottomColor = $pValue; } + /** + * Get border bottom color + */ public function getBorderBottomColor() { return $this->_borderBottomColor; } + /** + * Set border inside horizontal color + * + * @param string $pValue + */ public function setBorderInsideHColor($pValue = null) { $this->_borderInsideHColor = $pValue; } + /** + * Get border inside horizontal color + */ public function getBorderInsideHColor() { return (isset($this->_borderInsideHColor)) ? $this->_borderInsideHColor : null; } + /** + * Set border inside vertical color + * + * @param string $pValue + */ public function setBorderInsideVColor($pValue = null) { $this->_borderInsideVColor = $pValue; } + /** + * Get border inside vertical color + */ public function getBorderInsideVColor() { return (isset($this->_borderInsideVColor)) ? $this->_borderInsideVColor : null; } + /** + * Set border inside horizontal size + * + * @param int $pValue + */ public function setBorderInsideHSize($pValue = null) { $this->_borderInsideHSize = $pValue; } + /** + * Get border inside horizontal size + */ public function getBorderInsideHSize() { return (isset($this->_borderInsideHSize)) ? $this->_borderInsideHSize : null; } + /** + * Set border inside vertical size + * + * @param int $pValue + */ public function setBorderInsideVSize($pValue = null) { $this->_borderInsideVSize = $pValue; } + /** + * Get border inside vertical size + */ public function getBorderInsideVSize() { return (isset($this->_borderInsideVSize)) ? $this->_borderInsideVSize : null; } + /** + * Set cell margin top + * + * @param int $pValue + */ public function setCellMarginTop($pValue = null) { $this->_cellMarginTop = $pValue; } + /** + * Get cell margin top + */ public function getCellMarginTop() { return $this->_cellMarginTop; } + /** + * Set cell margin left + * + * @param int $pValue + */ public function setCellMarginLeft($pValue = null) { $this->_cellMarginLeft = $pValue; } + /** + * Get cell margin left + */ public function getCellMarginLeft() { return $this->_cellMarginLeft; } + /** + * Set cell margin right + * + * @param int $pValue + */ public function setCellMarginRight($pValue = null) { $this->_cellMarginRight = $pValue; } + /** + * Get cell margin right + */ public function getCellMarginRight() { return $this->_cellMarginRight; } + /** + * Set cell margin bottom + * + * @param int $pValue + */ public function setCellMarginBottom($pValue = null) { $this->_cellMarginBottom = $pValue; } + /** + * Get cell margin bottom + */ public function getCellMarginBottom() { return $this->_cellMarginBottom; @@ -479,6 +624,9 @@ class PHPWord_Style_TableFull $this->_cellMarginBottom = $pValue; } + /** + * Get cell margin + */ public function getCellMargin() { return array($this->_cellMarginTop, $this->_cellMarginLeft, $this->_cellMarginRight, $this->_cellMarginBottom); diff --git a/Classes/PHPWord/Style/Tabs.php b/Classes/PHPWord/Style/Tabs.php index a5e1a8bb..ece1315f 100755 --- a/Classes/PHPWord/Style/Tabs.php +++ b/Classes/PHPWord/Style/Tabs.php @@ -39,6 +39,7 @@ class PHPWord_Style_Tabs private $_tabs; /** + * Constructor * * @param array $tabs */ @@ -48,6 +49,7 @@ class PHPWord_Style_Tabs } /** + * Convert to XML * * @param PHPWord_Shared_XMLWriter $objWriter */ diff --git a/Classes/PHPWord/TOC.php b/Classes/PHPWord/TOC.php index c81fca22..499fdd64 100755 --- a/Classes/PHPWord/TOC.php +++ b/Classes/PHPWord/TOC.php @@ -105,6 +105,8 @@ class PHPWord_TOC /** * Add a Title * + * @param string $text + * @param int $depth * @return array */ public static function addTitle($text, $depth = 0) diff --git a/Classes/PHPWord/Writer/IWriter.php b/Classes/PHPWord/Writer/IWriter.php index f5ca8299..d00d2d40 100755 --- a/Classes/PHPWord/Writer/IWriter.php +++ b/Classes/PHPWord/Writer/IWriter.php @@ -33,8 +33,8 @@ interface PHPWord_Writer_IWriter /** * Save PHPWord to file * - * @param string $pFileName - * @throws Exception + * @param string $pFilename + * @throws Exception */ public function save($pFilename = null); } diff --git a/Classes/PHPWord/Writer/ODText.php b/Classes/PHPWord/Writer/ODText.php index 7d8c2e4b..e8ab61ee 100755 --- a/Classes/PHPWord/Writer/ODText.php +++ b/Classes/PHPWord/Writer/ODText.php @@ -68,7 +68,7 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter /** * Create a new PHPWord_Writer_ODText * - * @param PHPWord $pPHPWord + * @param PHPWord $pPHPWord */ public function __construct(PHPWord $pPHPWord = null) { @@ -98,8 +98,8 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter /** * Save PHPWord to file * - * @param string $pFileName - * @throws Exception + * @param string $pFilename + * @throws Exception */ public function save($pFilename = null) { @@ -212,8 +212,8 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter /** * Get PHPWord object * - * @param PHPWord $pPHPWord PHPWord object - * @throws Exception + * @param PHPWord $pPHPWord PHPWord object + * @throws Exception * @return PHPWord_Writer_ODText */ public function setPHPWord(PHPWord $pPHPWord = null) @@ -226,6 +226,7 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter * Get PHPWord_Worksheet_BaseDrawing HashTable * * @return PHPWord_HashTable + * @codeCoverageIgnore */ public function getDrawingHashTable() { @@ -235,8 +236,8 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter /** * Get writer part * - * @param string $pPartName Writer part name - * @return PHPWord_Writer_ODText_WriterPart + * @param string $pPartName Writer part name + * @return PHPWord_Writer_ODText_WriterPart */ public function getWriterPart($pPartName = '') { @@ -260,9 +261,9 @@ class PHPWord_Writer_ODText implements PHPWord_Writer_IWriter /** * Set use disk caching where possible? * - * @param boolean $pValue - * @param string $pDirectory Disk caching directory - * @throws Exception Exception when directory does not exist + * @param boolean $pValue + * @param string $pDirectory Disk caching directory + * @throws Exception Exception when directory does not exist * @return PHPWord_Writer_ODText */ public function setUseDiskCaching($pValue = false, $pDirectory = null) diff --git a/Classes/PHPWord/Writer/ODText/Content.php b/Classes/PHPWord/Writer/ODText/Content.php index 316e56fc..772e5408 100755 --- a/Classes/PHPWord/Writer/ODText/Content.php +++ b/Classes/PHPWord/Writer/ODText/Content.php @@ -344,9 +344,9 @@ class PHPWord_Writer_ODText_Content extends PHPWord_Writer_ODText_WriterPart /** * Write TextRun section * - * @param PHPWord_Shared_XMLWriter $objWriter - * @param PHPWord_Section_TextRun $textrun - * @todo Enable all other section types + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section_TextRun $textrun + * @todo Enable all other section types */ protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun) { @@ -364,6 +364,8 @@ class PHPWord_Writer_ODText_Content extends PHPWord_Writer_ODText_WriterPart /** * Write TextBreak + * + * @param PHPWord_Shared_XMLWriter $objWriter */ protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) { @@ -373,10 +375,22 @@ class PHPWord_Writer_ODText_Content extends PHPWord_Writer_ODText_WriterPart } // @codeCoverageIgnoreStart + /** + * Write end section + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section $section + */ private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null) { } + /** + * Write section + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Section $section + */ private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null) { } diff --git a/Classes/PHPWord/Writer/RTF.php b/Classes/PHPWord/Writer/RTF.php index a090fb17..03aee542 100755 --- a/Classes/PHPWord/Writer/RTF.php +++ b/Classes/PHPWord/Writer/RTF.php @@ -44,14 +44,31 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter */ private $_drawingHashTable; + /** + * Color table + * + * @var array + */ private $_colorTable; + + /** + * Font table + * + * @var array + */ private $_fontTable; + + /** + * Last paragraph style + * + * @var PHPWord_Style_Paragraph + */ private $_lastParagraphStyle; /** * Create a new PHPWord_Writer_ODText * - * @param PHPWord $pPHPWord + * @param PHPWord $pPHPWord */ public function __construct(PHPWord $pPHPWord = null) { @@ -65,8 +82,8 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter /** * Save PHPWord to file * - * @param string $pFileName - * @throws Exception + * @param string $pFilename + * @throws Exception */ public function save($pFilename = null) { @@ -115,8 +132,8 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter /** * Get PHPWord object * - * @param PHPWord $pPHPWord PHPWord object - * @throws Exception + * @param PHPWord $pPHPWord PHPWord object + * @throws Exception * @return PHPWord_Writer_RTF */ public function setPHPWord(PHPWord $pPHPWord = null) @@ -129,12 +146,18 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter * Get PHPWord_Worksheet_BaseDrawing HashTable * * @return PHPWord_HashTable + * @codeCoverageIgnore */ public function getDrawingHashTable() { return $this->_drawingHashTable; } + /** + * Get document data + * + * @return string + */ private function getData() { // PHPWord object : $this->_document @@ -188,6 +211,11 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter return $sRTFContent; } + /** + * Get font table + * + * @return array + */ private function getDataFont() { $pPHPWord = $this->_document; @@ -238,6 +266,11 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter return $arrFonts; } + /** + * Get color tables + * + * @return array + */ private function getDataColor() { $pPHPWord = $this->_document; @@ -294,6 +327,11 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter return $arrColors; } + /** + * Get content + * + * @return string + */ private function getDataContent() { $pPHPWord = $this->_document; @@ -342,6 +380,10 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter /** * Get text + * + * @param PHPWord_Section_Text $text + * @param boolean $withoutP + * @return string */ private function getDataContentText(PHPWord_Section_Text $text, $withoutP = false) { @@ -428,11 +470,15 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter if (!$withoutP) { $sRTFText .= '\par' . PHP_EOL; } + return $sRTFText; } /** * Get text run content + * + * @param PHPWord_Section_TextRun $textrun + * @return string */ private function getDataContentTextRun(PHPWord_Section_TextRun $textrun) { @@ -449,9 +495,15 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter } $sRTFText .= '\par' . PHP_EOL; } + return $sRTFText; } + /** + * Get text break + * + * @return string + */ private function getDataContentTextBreak() { $this->_lastParagraphStyle = ''; @@ -463,6 +515,7 @@ class PHPWord_Writer_RTF implements PHPWord_Writer_IWriter * Write unsupported element * * @param string $element + * @return string */ private function getDataContentUnsupportedElement($element) { diff --git a/Classes/PHPWord/Writer/Word2007.php b/Classes/PHPWord/Writer/Word2007.php index 989fa93f..16d66c66 100755 --- a/Classes/PHPWord/Writer/Word2007.php +++ b/Classes/PHPWord/Writer/Word2007.php @@ -24,7 +24,6 @@ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version 0.8.0 */ - use PhpOffice\PhpWord\Exceptions\InvalidImageException; use PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException; @@ -33,15 +32,54 @@ use PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException; */ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter { - + /** + * PHPWord object + * + * @var PHPWord + */ private $_document; + + /** + * Writer parts + * + * @var array + */ private $_writerParts; + + /** + * Directory for caching + * + * @var string + */ private $_diskCachingDirectory; + + /** + * Use disk caching + * + * @var boolean + */ private $_useDiskCaching = false; + + /** + * Image types + * + * @var array + */ private $_imageTypes = array(); + + /** + * Object types + * + * @var array + */ private $_objectTypes = array(); - public function __construct(PHPWord $PHPWord = null) + /** + * Constructor + * + * @param PHPWord $PHPWord + */ + public function __construct(PHPWord $PHPWord = null) { $this->_document = $PHPWord; @@ -63,6 +101,11 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter } } + /** + * Save + * + * @param string $pFilename + */ public function save($pFilename = null) { if (!is_null($this->_document)) { @@ -204,6 +247,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter } /** + * Check content types + * * @param string $src */ private function checkContentTypes($src) @@ -230,6 +275,11 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter } } + /** + * Get writer part + * + * @param string $pPartName + */ public function getWriterPart($pPartName = '') { if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) { @@ -239,11 +289,20 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter } } + /** + * Get use disk catching setting + */ public function getUseDiskCaching() { return $this->_useDiskCaching; } + /** + * Set use disk catching setting + * + * @param boolean $pValue + * @param string $pDirectory + */ public function setUseDiskCaching($pValue = false, $pDirectory = null) { $this->_useDiskCaching = $pValue; @@ -259,6 +318,12 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter return $this; } + /** + * Add file to package + * + * @param mixed $objZip + * @param array $element + */ private function _addFileToPackage($objZip, $element) { if (isset($element['isMemImage']) && $element['isMemImage']) { diff --git a/Classes/PHPWord/Writer/Word2007/Base.php b/Classes/PHPWord/Writer/Word2007/Base.php index e9249120..d829bf92 100755 --- a/Classes/PHPWord/Writer/Word2007/Base.php +++ b/Classes/PHPWord/Writer/Word2007/Base.php @@ -31,9 +31,10 @@ */ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart { - /** * Write text + * + * @param boolean $withoutP */ protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Text $text, $withoutP = false) { @@ -232,6 +233,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart /** * Write link + * + * @param boolean $withoutP */ protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Link $link, $withoutP = false) { @@ -791,8 +794,11 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart } /** + * Write image + * * @param \PHPWord_Shared_XMLWriter $objWriter * @param \PHPWord_Section_Image|\PHPWord_Section_MemoryImage $image + * @param boolean $withoutP */ protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, $image, $withoutP = false) { @@ -873,6 +879,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart /** * Write watermark + * + * @param PHP_Section_Image|PHP_Section_MemoryImage $image */ protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image) { @@ -1003,6 +1011,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart /** * Write footnote reference + * + * @param boolean $withoutP */ protected function _writeFootnoteReference(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footnote $footnote, $withoutP = false) { diff --git a/Classes/PHPWord/Writer/Word2007/ContentTypes.php b/Classes/PHPWord/Writer/Word2007/ContentTypes.php index 8a6e39ef..26032ae1 100755 --- a/Classes/PHPWord/Writer/Word2007/ContentTypes.php +++ b/Classes/PHPWord/Writer/Word2007/ContentTypes.php @@ -30,7 +30,15 @@ */ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_WriterPart { - + /** + * Write contenttypes.xml + * + * @param array $_imageTypes + * @param array $_objectTypes + * @param int $_cHdrs + * @param array $footers + * @return string XML data + */ public function writeContentTypes($_imageTypes, $_objectTypes, $_cHdrs, $footers) { // Create XML writer @@ -163,7 +171,6 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write } } - $objWriter->endElement(); // Return @@ -173,9 +180,9 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write /** * Get image mime type * - * @param string $pFile Filename - * @return string Mime Type - * @throws Exception + * @param string $pFile Filename + * @return string Mime Type + * @throws Exception */ private function _getImageMimeType($pFile = '') { @@ -190,10 +197,10 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write /** * Write Default content type * - * @param PHPWord_Shared_XMLWriter $objWriter XML Writer - * @param string $pPartname Part name - * @param string $pContentType Content type - * @throws Exception + * @param PHPWord_Shared_XMLWriter $objWriter XML Writer + * @param string $pPartname Part name + * @param string $pContentType Content type + * @throws Exception */ private function _writeDefaultContentType(PHPWord_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { @@ -211,10 +218,10 @@ class PHPWord_Writer_Word2007_ContentTypes extends PHPWord_Writer_Word2007_Write /** * Write Override content type * - * @param PHPWord_Shared_XMLWriter $objWriter XML Writer - * @param string $pPartname Part name - * @param string $pContentType Content type - * @throws Exception + * @param PHPWord_Shared_XMLWriter $objWriter XML Writer + * @param string $pPartname Part name + * @param string $pContentType Content type + * @throws Exception */ private function _writeOverrideContentType(PHPWord_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') { diff --git a/Classes/PHPWord/Writer/Word2007/DocProps.php b/Classes/PHPWord/Writer/Word2007/DocProps.php index 2e8f8b5a..b2ec6f39 100755 --- a/Classes/PHPWord/Writer/Word2007/DocProps.php +++ b/Classes/PHPWord/Writer/Word2007/DocProps.php @@ -30,7 +30,12 @@ */ class PHPWord_Writer_Word2007_DocProps extends PHPWord_Writer_Word2007_WriterPart { - + /** + * Write app.xml + * + * @param PHPWord $pPHPWord + * @return string XML data + */ public function writeDocPropsApp(PHPWord $pPHPWord = null) { // Create XML writer @@ -122,7 +127,12 @@ class PHPWord_Writer_Word2007_DocProps extends PHPWord_Writer_Word2007_WriterPar return $objWriter->getData(); } - + /** + * Write core.xml + * + * @param PHPWord $pPHPWord + * @return string XML data + */ public function writeDocPropsCore(PHPWord $pPHPWord = null) { // Create XML writer diff --git a/Classes/PHPWord/Writer/Word2007/Document.php b/Classes/PHPWord/Writer/Word2007/Document.php index abdd92cc..1bd86152 100755 --- a/Classes/PHPWord/Writer/Word2007/Document.php +++ b/Classes/PHPWord/Writer/Word2007/Document.php @@ -30,7 +30,9 @@ */ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base { - + /** + * Write document.xml + */ public function writeDocument(PHPWord $pPHPWord = null) { // Create XML writer @@ -114,6 +116,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base return $objWriter->getData(); } + /** + * Write section start + */ private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section) { $objWriter->startElement('w:p'); @@ -123,6 +128,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base $objWriter->endElement(); } + /** + * Write section end + */ private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section) { $settings = $section->getSettings(); @@ -256,6 +264,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base $objWriter->endElement(); } + /** + * Write page break element + */ private function _writePageBreak(PHPWord_Shared_XMLWriter $objWriter = null) { $objWriter->startElement('w:p'); @@ -267,6 +278,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base $objWriter->endElement(); } + /** + * Write list item element + */ public function _writeListItem(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_ListItem $listItem) { $textObject = $listItem->getTextObject(); @@ -306,6 +320,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base $objWriter->endElement(); } + /** + * Write object element + */ protected function _writeObject(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Object $object) { $rIdObject = $object->getRelationId(); @@ -365,6 +382,9 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base $objWriter->endElement(); // w:p } + /** + * Write TOC element + */ private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null) { $titles = PHPWord_TOC::getTitles(); diff --git a/Classes/PHPWord/Writer/Word2007/DocumentRels.php b/Classes/PHPWord/Writer/Word2007/DocumentRels.php index 9817a31f..eda62c5e 100755 --- a/Classes/PHPWord/Writer/Word2007/DocumentRels.php +++ b/Classes/PHPWord/Writer/Word2007/DocumentRels.php @@ -30,7 +30,12 @@ */ class PHPWord_Writer_Word2007_DocumentRels extends PHPWord_Writer_Word2007_WriterPart { - + /** + * Write word/_rels/document.xml.rels + * + * @param array $_relsCollection + * @return string XML data + */ public function writeDocumentRels($_relsCollection) { // Create XML writer @@ -119,6 +124,12 @@ class PHPWord_Writer_Word2007_DocumentRels extends PHPWord_Writer_Word2007_Write return $objWriter->getData(); } + /** + * Write word/_rels/(header|footer)(\d).xml.rels + * + * @param array $_relsCollection + * @return string XML data + */ public function writeHeaderFooterRels($_relsCollection) { // Create XML writer @@ -150,13 +161,21 @@ class PHPWord_Writer_Word2007_DocumentRels extends PHPWord_Writer_Word2007_Write ); } - $objWriter->endElement(); // Return return $objWriter->getData(); } + /** + * Write individual relations + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param int $pId + * @param string $pType + * @param string $pTarget + * @param string $pTargetMode + */ private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if ($pType != '' && $pTarget != '') { diff --git a/Classes/PHPWord/Writer/Word2007/Footer.php b/Classes/PHPWord/Writer/Word2007/Footer.php index 6ee18d66..ef81fdb0 100755 --- a/Classes/PHPWord/Writer/Word2007/Footer.php +++ b/Classes/PHPWord/Writer/Word2007/Footer.php @@ -30,7 +30,12 @@ */ class PHPWord_Writer_Word2007_Footer extends PHPWord_Writer_Word2007_Base { - + /** + * Write footer + * + * @param PHPWord_Section_Footer $footer + * @return string XML data + */ public function writeFooter(PHPWord_Section_Footer $footer) { // Create XML writer diff --git a/Classes/PHPWord/Writer/Word2007/Footnotes.php b/Classes/PHPWord/Writer/Word2007/Footnotes.php index 28d087c7..5d0680ce 100644 --- a/Classes/PHPWord/Writer/Word2007/Footnotes.php +++ b/Classes/PHPWord/Writer/Word2007/Footnotes.php @@ -25,9 +25,17 @@ * @version 0.8.0 */ - +/** + * Class PHPWord_Writer_Word2007_Footnotes + */ class PHPWord_Writer_Word2007_Footnotes extends PHPWord_Writer_Word2007_Base { + /** + * Write footnotes.xml + * + * @param array $allFootnotesCollection + * @return string XML data + */ public function writeFootnotes($allFootnotesCollection) { // Create XML writer diff --git a/Classes/PHPWord/Writer/Word2007/FootnotesRels.php b/Classes/PHPWord/Writer/Word2007/FootnotesRels.php index 0e562b59..48721985 100644 --- a/Classes/PHPWord/Writer/Word2007/FootnotesRels.php +++ b/Classes/PHPWord/Writer/Word2007/FootnotesRels.php @@ -25,9 +25,16 @@ * @version 0.8.0 */ - +/** + * Class PHPWord_Writer_Word2007_FootnotesRels + */ class PHPWord_Writer_Word2007_FootnotesRels extends PHPWord_Writer_Word2007_WriterPart { + /** + * Write footnotes relationships + * + * @param array $_relsCollection + */ public function writeFootnotesRels($_relsCollection) { // Create XML writer @@ -61,6 +68,15 @@ class PHPWord_Writer_Word2007_FootnotesRels extends PHPWord_Writer_Word2007_Writ return $objWriter->getData(); } + /** + * Write individual relations + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param int $pId + * @param string $pType + * @param string $pTarget + * @param string $pTargetMode + */ private function _writeRelationship(PHPWord_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') { if ($pType != '' && $pTarget != '') { diff --git a/Classes/PHPWord/Writer/Word2007/Header.php b/Classes/PHPWord/Writer/Word2007/Header.php index 59eebd91..0c11183b 100755 --- a/Classes/PHPWord/Writer/Word2007/Header.php +++ b/Classes/PHPWord/Writer/Word2007/Header.php @@ -30,7 +30,12 @@ */ class PHPWord_Writer_Word2007_Header extends PHPWord_Writer_Word2007_Base { - + /** + * Write header + * + * @param PHPWord_Section_Header $header + * @return string XML data + */ public function writeHeader(PHPWord_Section_Header $header) { // Create XML writer diff --git a/Classes/PHPWord/Writer/Word2007/Rels.php b/Classes/PHPWord/Writer/Word2007/Rels.php index 06eb59cc..9304bda6 100755 --- a/Classes/PHPWord/Writer/Word2007/Rels.php +++ b/Classes/PHPWord/Writer/Word2007/Rels.php @@ -30,7 +30,11 @@ */ class PHPWord_Writer_Word2007_Rels extends PHPWord_Writer_Word2007_WriterPart { - + /** + * Write _rels/.rels + * + * @param PHPWord $pPHPWord + */ public function writeRelationships(PHPWord $pPHPWord = null) { // Create XML writer diff --git a/Classes/PHPWord/Writer/Word2007/Styles.php b/Classes/PHPWord/Writer/Word2007/Styles.php index 3724323e..1f61051a 100755 --- a/Classes/PHPWord/Writer/Word2007/Styles.php +++ b/Classes/PHPWord/Writer/Word2007/Styles.php @@ -30,9 +30,18 @@ */ class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base { - + /** + * PHPWord object + * + * @var PHPWord + */ private $_document; + /** + * Write styles + * + * @param PHPWord $pPHPWord + */ public function writeStyles(PHPWord $pPHPWord = null) { // Create XML writer @@ -181,6 +190,12 @@ class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base return $objWriter->getData(); } + /** + * Write style + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param PHPWord_Style_TableFull $style + */ private function _writeFullTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_TableFull $style) { @@ -302,6 +317,13 @@ class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base } } + /** + * Write row style + * + * @param PHPWord_Shared_XMLWriter $objWriter + * @param string $type + * @param PHPWord_Style_TableFull $style + */ private function _writeRowStyle(PHPWord_Shared_XMLWriter $objWriter = null, $type, PHPWord_Style_TableFull $style) { $brdSz = $style->getBorderSize(); @@ -362,7 +384,11 @@ class PHPWord_Writer_Word2007_Styles extends PHPWord_Writer_Word2007_Base $objWriter->endElement(); } - + /** + * Write doc defaults + * + * @param PHPWord_Shared_XMLWriter $objWriter + */ private function _writeDocDefaults(PHPWord_Shared_XMLWriter $objWriter = null) { $fontName = $this->_document->getDefaultFontName(); diff --git a/Classes/PHPWord/Writer/Word2007/WriterPart.php b/Classes/PHPWord/Writer/Word2007/WriterPart.php index cc004254..35cf348f 100755 --- a/Classes/PHPWord/Writer/Word2007/WriterPart.php +++ b/Classes/PHPWord/Writer/Word2007/WriterPart.php @@ -30,13 +30,28 @@ */ abstract class PHPWord_Writer_Word2007_WriterPart { + /** + * Parent writer object + * + * @var PHPWord_Writer_Word2007 + */ private $_parentWriter; + /** + * Set parent writer + * + * @param PHPWord_Writer_IWriter + */ public function setParentWriter(PHPWord_Writer_IWriter $pWriter = null) { $this->_parentWriter = $pWriter; } + /** + * Get parent writer + * + * @return PHPWord_Writer_IWriter + */ public function getParentWriter() { if (!is_null($this->_parentWriter)) {