DocBlock and use fixes
This commit is contained in:
parent
1ebd26ddc6
commit
7c549f5802
|
|
@ -16,6 +16,7 @@ use PhpOffice\PhpWord\Style;
|
||||||
use PhpOffice\PhpWord\TOC;
|
use PhpOffice\PhpWord\TOC;
|
||||||
use PhpOffice\PhpWord\Footnote as FootnoteCollection;
|
use PhpOffice\PhpWord\Footnote as FootnoteCollection;
|
||||||
use PhpOffice\PhpWord\Shared\String;
|
use PhpOffice\PhpWord\Shared\String;
|
||||||
|
use PhpOffice\PhpWord\Element\Element;
|
||||||
use PhpOffice\PhpWord\Element\Text;
|
use PhpOffice\PhpWord\Element\Text;
|
||||||
use PhpOffice\PhpWord\Element\TextRun;
|
use PhpOffice\PhpWord\Element\TextRun;
|
||||||
use PhpOffice\PhpWord\Element\Link;
|
use PhpOffice\PhpWord\Element\Link;
|
||||||
|
|
@ -34,7 +35,7 @@ use PhpOffice\PhpWord\Element\CheckBox;
|
||||||
*
|
*
|
||||||
* @since 0.9.2
|
* @since 0.9.2
|
||||||
*/
|
*/
|
||||||
abstract class Container
|
abstract class Container extends Element
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Container type section|header|footer|cell|textrun|footnote
|
* Container type section|header|footer|cell|textrun|footnote
|
||||||
|
|
@ -53,7 +54,7 @@ abstract class Container
|
||||||
/**
|
/**
|
||||||
* Elements collection
|
* Elements collection
|
||||||
*
|
*
|
||||||
* @var int
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $elements = array();
|
protected $elements = array();
|
||||||
|
|
||||||
|
|
@ -487,37 +488,10 @@ abstract class Container
|
||||||
return $this->addFootnote($paragraphStyle);
|
return $this->addFootnote($paragraphStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set style value
|
|
||||||
*
|
|
||||||
* Used by Footnote
|
|
||||||
*
|
|
||||||
* @param mixed $styleObject Style object, could be Font, Paragraph, Cell, Image
|
|
||||||
* @param mixed $styleValue
|
|
||||||
* @param boolean $returnObject Always return object
|
|
||||||
* @todo Remove duplicate with ..\Element\Element
|
|
||||||
*/
|
|
||||||
protected function setStyle($styleObject, $styleValue = null, $returnObject = false)
|
|
||||||
{
|
|
||||||
if (!is_null($styleValue) && is_array($styleValue)) {
|
|
||||||
foreach ($styleValue as $key => $value) {
|
|
||||||
if (substr($key, 0, 1) != '_') {
|
|
||||||
$key = '_' . $key;
|
|
||||||
}
|
|
||||||
$styleObject->setStyleValue($key, $value);
|
|
||||||
}
|
|
||||||
$style = $styleObject;
|
|
||||||
} else {
|
|
||||||
$style = $returnObject ? $styleObject : $styleValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $style;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a method is allowed for the current container
|
* Check if a method is allowed for the current container
|
||||||
*
|
*
|
||||||
* @param string $element
|
* @param string $method
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
private function checkValidity($method)
|
private function checkValidity($method)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class Header extends Container
|
||||||
/**
|
/**
|
||||||
* Create new instance
|
* Create new instance
|
||||||
*
|
*
|
||||||
* @param int $sectionCount
|
* @param int $sectionId
|
||||||
*/
|
*/
|
||||||
public function __construct($sectionId)
|
public function __construct($sectionId)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ class Section extends Container
|
||||||
* Create new instance
|
* Create new instance
|
||||||
*
|
*
|
||||||
* @param int $sectionCount
|
* @param int $sectionCount
|
||||||
* @param mixed $settings
|
* @param array $settings
|
||||||
*/
|
*/
|
||||||
public function __construct($sectionCount, $settings = null)
|
public function __construct($sectionCount, $settings = null)
|
||||||
{
|
{
|
||||||
|
|
@ -132,7 +132,7 @@ class Section extends Container
|
||||||
/**
|
/**
|
||||||
* Get Headers
|
* Get Headers
|
||||||
*
|
*
|
||||||
* @return array
|
* @return Header[]
|
||||||
*/
|
*/
|
||||||
public function getHeaders()
|
public function getHeaders()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -27,101 +27,101 @@ class DocumentProperties
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_creator;
|
private $creator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LastModifiedBy
|
* LastModifiedBy
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_lastModifiedBy;
|
private $lastModifiedBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created
|
* Created
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
private $_created;
|
private $created;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modified
|
* Modified
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
private $_modified;
|
private $modified;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Title
|
* Title
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_title;
|
private $title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_description;
|
private $description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subject
|
* Subject
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_subject;
|
private $subject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keywords
|
* Keywords
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_keywords;
|
private $keywords;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Category
|
* Category
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_category;
|
private $category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Company
|
* Company
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_company;
|
private $company;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manager
|
* Manager
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_manager;
|
private $manager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom Properties
|
* Custom Properties
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
private $_customProperties = array();
|
private $customProperties = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new DocumentProperties
|
* Create new DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->_creator = '';
|
$this->creator = '';
|
||||||
$this->_lastModifiedBy = $this->_creator;
|
$this->lastModifiedBy = $this->creator;
|
||||||
$this->_created = time();
|
$this->created = time();
|
||||||
$this->_modified = time();
|
$this->modified = time();
|
||||||
$this->_title = '';
|
$this->title = '';
|
||||||
$this->_subject = '';
|
$this->subject = '';
|
||||||
$this->_description = '';
|
$this->description = '';
|
||||||
$this->_keywords = '';
|
$this->keywords = '';
|
||||||
$this->_category = '';
|
$this->category = '';
|
||||||
$this->_company = '';
|
$this->company = '';
|
||||||
$this->_manager = '';
|
$this->manager = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -131,7 +131,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getCreator()
|
public function getCreator()
|
||||||
{
|
{
|
||||||
return $this->_creator;
|
return $this->creator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -142,7 +142,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setCreator($pValue = '')
|
public function setCreator($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_creator = $pValue;
|
$this->creator = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -153,7 +153,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getLastModifiedBy()
|
public function getLastModifiedBy()
|
||||||
{
|
{
|
||||||
return $this->_lastModifiedBy;
|
return $this->lastModifiedBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -164,7 +164,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setLastModifiedBy($pValue = '')
|
public function setLastModifiedBy($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_lastModifiedBy = $pValue;
|
$this->lastModifiedBy = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -175,7 +175,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getCreated()
|
public function getCreated()
|
||||||
{
|
{
|
||||||
return $this->_created;
|
return $this->created;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -189,7 +189,7 @@ class DocumentProperties
|
||||||
if (is_null($pValue)) {
|
if (is_null($pValue)) {
|
||||||
$pValue = time();
|
$pValue = time();
|
||||||
}
|
}
|
||||||
$this->_created = $pValue;
|
$this->created = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -200,7 +200,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getModified()
|
public function getModified()
|
||||||
{
|
{
|
||||||
return $this->_modified;
|
return $this->modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -214,7 +214,7 @@ class DocumentProperties
|
||||||
if (is_null($pValue)) {
|
if (is_null($pValue)) {
|
||||||
$pValue = time();
|
$pValue = time();
|
||||||
}
|
}
|
||||||
$this->_modified = $pValue;
|
$this->modified = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -225,7 +225,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return $this->_title;
|
return $this->title;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -236,7 +236,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setTitle($pValue = '')
|
public function setTitle($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_title = $pValue;
|
$this->title = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -247,7 +247,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return $this->_description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -258,7 +258,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setDescription($pValue = '')
|
public function setDescription($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_description = $pValue;
|
$this->description = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -269,7 +269,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getSubject()
|
public function getSubject()
|
||||||
{
|
{
|
||||||
return $this->_subject;
|
return $this->subject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -280,7 +280,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setSubject($pValue = '')
|
public function setSubject($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_subject = $pValue;
|
$this->subject = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -291,7 +291,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getKeywords()
|
public function getKeywords()
|
||||||
{
|
{
|
||||||
return $this->_keywords;
|
return $this->keywords;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -302,7 +302,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setKeywords($pValue = '')
|
public function setKeywords($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_keywords = $pValue;
|
$this->keywords = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -313,7 +313,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getCategory()
|
public function getCategory()
|
||||||
{
|
{
|
||||||
return $this->_category;
|
return $this->category;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -324,7 +324,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setCategory($pValue = '')
|
public function setCategory($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_category = $pValue;
|
$this->category = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -335,7 +335,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getCompany()
|
public function getCompany()
|
||||||
{
|
{
|
||||||
return $this->_company;
|
return $this->company;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -346,7 +346,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setCompany($pValue = '')
|
public function setCompany($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_company = $pValue;
|
$this->company = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -357,7 +357,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getManager()
|
public function getManager()
|
||||||
{
|
{
|
||||||
return $this->_manager;
|
return $this->manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -368,7 +368,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function setManager($pValue = '')
|
public function setManager($pValue = '')
|
||||||
{
|
{
|
||||||
$this->_manager = $pValue;
|
$this->manager = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -379,7 +379,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getCustomProperties()
|
public function getCustomProperties()
|
||||||
{
|
{
|
||||||
return array_keys($this->_customProperties);
|
return array_keys($this->customProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -390,7 +390,7 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function isCustomPropertySet($propertyName)
|
public function isCustomPropertySet($propertyName)
|
||||||
{
|
{
|
||||||
return isset($this->_customProperties[$propertyName]);
|
return isset($this->customProperties[$propertyName]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -401,8 +401,8 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getCustomPropertyValue($propertyName)
|
public function getCustomPropertyValue($propertyName)
|
||||||
{
|
{
|
||||||
if (isset($this->_customProperties[$propertyName])) {
|
if (isset($this->customProperties[$propertyName])) {
|
||||||
return $this->_customProperties[$propertyName]['value'];
|
return $this->customProperties[$propertyName]['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -415,8 +415,8 @@ class DocumentProperties
|
||||||
*/
|
*/
|
||||||
public function getCustomPropertyType($propertyName)
|
public function getCustomPropertyType($propertyName)
|
||||||
{
|
{
|
||||||
if (isset($this->_customProperties[$propertyName])) {
|
if (isset($this->customProperties[$propertyName])) {
|
||||||
return $this->_customProperties[$propertyName]['type'];
|
return $this->customProperties[$propertyName]['type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -457,7 +457,7 @@ class DocumentProperties
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_customProperties[$propertyName] = array(
|
$this->customProperties[$propertyName] = array(
|
||||||
'value' => $propertyValue,
|
'value' => $propertyValue,
|
||||||
'type' => $propertyType
|
'type' => $propertyType
|
||||||
);
|
);
|
||||||
|
|
@ -465,11 +465,11 @@ class DocumentProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert document propery based on type
|
* Convert document property based on type
|
||||||
*
|
*
|
||||||
* @param mixed $propertyValue
|
* @param string $propertyValue
|
||||||
* @param string $propertyType
|
* @param string $propertyType
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public static function convertProperty($propertyValue, $propertyType)
|
public static function convertProperty($propertyValue, $propertyType)
|
||||||
{
|
{
|
||||||
|
|
@ -525,8 +525,8 @@ class DocumentProperties
|
||||||
/**
|
/**
|
||||||
* Convert document property type
|
* Convert document property type
|
||||||
*
|
*
|
||||||
* @param string $propertyType
|
* @param string $propertyType
|
||||||
* @return mixed
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function convertPropertyType($propertyType)
|
public static function convertPropertyType($propertyType)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class Image extends Element
|
||||||
/**
|
/**
|
||||||
* Is watermark
|
* Is watermark
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
private $isWatermark;
|
private $isWatermark;
|
||||||
|
|
||||||
|
|
@ -77,7 +77,7 @@ class Image extends Element
|
||||||
/**
|
/**
|
||||||
* Is memory image
|
* Is memory image
|
||||||
*
|
*
|
||||||
* @var string
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
private $isMemImage;
|
private $isMemImage;
|
||||||
|
|
||||||
|
|
@ -86,7 +86,7 @@ class Image extends Element
|
||||||
*
|
*
|
||||||
* @param string $source
|
* @param string $source
|
||||||
* @param mixed $style
|
* @param mixed $style
|
||||||
* @param bool $isWatermark
|
* @param boolean $isWatermark
|
||||||
* @throws \PhpOffice\PhpWord\Exception\InvalidImageException
|
* @throws \PhpOffice\PhpWord\Exception\InvalidImageException
|
||||||
* @throws \PhpOffice\PhpWord\Exception\UnsupportedImageTypeException
|
* @throws \PhpOffice\PhpWord\Exception\UnsupportedImageTypeException
|
||||||
*/
|
*/
|
||||||
|
|
@ -196,7 +196,7 @@ class Image extends Element
|
||||||
/**
|
/**
|
||||||
* Get is watermark
|
* Get is watermark
|
||||||
*
|
*
|
||||||
* @return int
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function getIsWatermark()
|
public function getIsWatermark()
|
||||||
{
|
{
|
||||||
|
|
@ -206,7 +206,7 @@ class Image extends Element
|
||||||
/**
|
/**
|
||||||
* Set is watermark
|
* Set is watermark
|
||||||
*
|
*
|
||||||
* @param bool $pValue
|
* @param boolean $pValue
|
||||||
*/
|
*/
|
||||||
public function setIsWatermark($pValue)
|
public function setIsWatermark($pValue)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class TextRun extends Container
|
||||||
* Create new instance
|
* Create new instance
|
||||||
*
|
*
|
||||||
* @param string|array|Paragraph $paragraphStyle
|
* @param string|array|Paragraph $paragraphStyle
|
||||||
* @param string $docPartType section|header|footer
|
* @param string $docPart section|header|footer
|
||||||
* @param int $docPartId
|
* @param int $docPartId
|
||||||
*/
|
*/
|
||||||
public function __construct($paragraphStyle = null, $docPart = 'section', $docPartId = 1)
|
public function __construct($paragraphStyle = null, $docPart = 'section', $docPartId = 1)
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ class Title extends Element
|
||||||
*
|
*
|
||||||
* @param string $text
|
* @param string $text
|
||||||
* @param int $depth
|
* @param int $depth
|
||||||
* @param mixed $style
|
* @param string $style Name of the heading style, e.g. 'Heading1'
|
||||||
*/
|
*/
|
||||||
public function __construct($text, $depth = 1, $style = null)
|
public function __construct($text, $depth = 1, $style = null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ class Media
|
||||||
* @param string $src
|
* @param string $src
|
||||||
* @param string $type
|
* @param string $type
|
||||||
* @param Image $image
|
* @param Image $image
|
||||||
* @return mixed
|
* @return integer|array
|
||||||
*/
|
*/
|
||||||
public static function addSectionMediaElement($src, $type, Image $image = null)
|
public static function addSectionMediaElement($src, $type, Image $image = null)
|
||||||
{
|
{
|
||||||
|
|
@ -115,7 +115,7 @@ class Media
|
||||||
* Add new Section Link Element
|
* Add new Section Link Element
|
||||||
*
|
*
|
||||||
* @param string $linkSrc
|
* @param string $linkSrc
|
||||||
* @return mixed
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public static function addSectionLinkElement($linkSrc)
|
public static function addSectionLinkElement($linkSrc)
|
||||||
{
|
{
|
||||||
|
|
@ -340,6 +340,7 @@ class Media
|
||||||
* Get media elements
|
* Get media elements
|
||||||
*
|
*
|
||||||
* @param string $container
|
* @param string $container
|
||||||
|
* @param string $mediaType
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public static function getMediaElements($container, $mediaType = null)
|
public static function getMediaElements($container, $mediaType = null)
|
||||||
|
|
|
||||||
|
|
@ -37,36 +37,36 @@ class PhpWord
|
||||||
*
|
*
|
||||||
* @var DocumentProperties
|
* @var DocumentProperties
|
||||||
*/
|
*/
|
||||||
private $_documentProperties;
|
private $documentProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default font name
|
* Default font name
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $_defaultFontName;
|
private $defaultFontName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default font size
|
* Default font size
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
private $_defaultFontSize;
|
private $defaultFontSize;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collection of sections
|
* Collection of sections
|
||||||
*
|
*
|
||||||
* @var Section[]
|
* @var Section[]
|
||||||
*/
|
*/
|
||||||
private $_sections = array();
|
private $sections = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new
|
* Create new
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->_documentProperties = new DocumentProperties();
|
$this->documentProperties = new DocumentProperties();
|
||||||
$this->_defaultFontName = self::DEFAULT_FONT_NAME;
|
$this->defaultFontName = self::DEFAULT_FONT_NAME;
|
||||||
$this->_defaultFontSize = self::DEFAULT_FONT_SIZE;
|
$this->defaultFontSize = self::DEFAULT_FONT_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -76,7 +76,7 @@ class PhpWord
|
||||||
*/
|
*/
|
||||||
public function getDocumentProperties()
|
public function getDocumentProperties()
|
||||||
{
|
{
|
||||||
return $this->_documentProperties;
|
return $this->documentProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -87,7 +87,7 @@ class PhpWord
|
||||||
*/
|
*/
|
||||||
public function setDocumentProperties(DocumentProperties $documentProperties)
|
public function setDocumentProperties(DocumentProperties $documentProperties)
|
||||||
{
|
{
|
||||||
$this->_documentProperties = $documentProperties;
|
$this->documentProperties = $documentProperties;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
@ -100,8 +100,8 @@ class PhpWord
|
||||||
*/
|
*/
|
||||||
public function addSection($settings = null)
|
public function addSection($settings = null)
|
||||||
{
|
{
|
||||||
$section = new Section(\count($this->_sections) + 1, $settings);
|
$section = new Section(\count($this->sections) + 1, $settings);
|
||||||
$this->_sections[] = $section;
|
$this->sections[] = $section;
|
||||||
|
|
||||||
return $section;
|
return $section;
|
||||||
}
|
}
|
||||||
|
|
@ -113,7 +113,7 @@ class PhpWord
|
||||||
*/
|
*/
|
||||||
public function getDefaultFontName()
|
public function getDefaultFontName()
|
||||||
{
|
{
|
||||||
return $this->_defaultFontName;
|
return $this->defaultFontName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -123,17 +123,17 @@ class PhpWord
|
||||||
*/
|
*/
|
||||||
public function setDefaultFontName($fontName)
|
public function setDefaultFontName($fontName)
|
||||||
{
|
{
|
||||||
$this->_defaultFontName = $fontName;
|
$this->defaultFontName = $fontName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get default font size
|
* Get default font size
|
||||||
*
|
*
|
||||||
* @return string
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getDefaultFontSize()
|
public function getDefaultFontSize()
|
||||||
{
|
{
|
||||||
return $this->_defaultFontSize;
|
return $this->defaultFontSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -143,7 +143,7 @@ class PhpWord
|
||||||
*/
|
*/
|
||||||
public function setDefaultFontSize($fontSize)
|
public function setDefaultFontSize($fontSize)
|
||||||
{
|
{
|
||||||
$this->_defaultFontSize = $fontSize;
|
$this->defaultFontSize = $fontSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -159,8 +159,8 @@ class PhpWord
|
||||||
/**
|
/**
|
||||||
* Adds a paragraph style definition to styles.xml
|
* Adds a paragraph style definition to styles.xml
|
||||||
*
|
*
|
||||||
* @param $styleName string
|
* @param string $styleName
|
||||||
* @param $styles array
|
* @param array $styles
|
||||||
*/
|
*/
|
||||||
public function addParagraphStyle($styleName, $styles)
|
public function addParagraphStyle($styleName, $styles)
|
||||||
{
|
{
|
||||||
|
|
@ -170,7 +170,7 @@ class PhpWord
|
||||||
/**
|
/**
|
||||||
* Adds a font style definition to styles.xml
|
* Adds a font style definition to styles.xml
|
||||||
*
|
*
|
||||||
* @param $styleName string
|
* @param string $styleName
|
||||||
* @param mixed $styleFont
|
* @param mixed $styleFont
|
||||||
* @param mixed $styleParagraph
|
* @param mixed $styleParagraph
|
||||||
*/
|
*/
|
||||||
|
|
@ -221,7 +221,7 @@ class PhpWord
|
||||||
*/
|
*/
|
||||||
public function getSections()
|
public function getSections()
|
||||||
{
|
{
|
||||||
return $this->_sections;
|
return $this->sections;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ class Word2007 extends Reader implements IReader
|
||||||
* @param mixed $archive
|
* @param mixed $archive
|
||||||
* @param string $fileName
|
* @param string $fileName
|
||||||
* @param bool $removeNamespace
|
* @param bool $removeNamespace
|
||||||
* @return mixed
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getFromZipArchive($archive, $fileName = '', $removeNamespace = false)
|
public function getFromZipArchive($archive, $fileName = '', $removeNamespace = false)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ class Font
|
||||||
/**
|
/**
|
||||||
* Calculate an (approximate) pixel size, based on a font points size
|
* Calculate an (approximate) pixel size, based on a font points size
|
||||||
*
|
*
|
||||||
* @param int $fontSizeInPoints Font size (in points)
|
* @param int $fontSizeInPoints Font size (in points)
|
||||||
* @return int Font size (in pixels)
|
* @return int Font size (in pixels)
|
||||||
*/
|
*/
|
||||||
public static function fontSizeToPixels($fontSizeInPoints = 12)
|
public static function fontSizeToPixels($fontSizeInPoints = 12)
|
||||||
{
|
{
|
||||||
|
|
@ -40,7 +40,7 @@ class Font
|
||||||
* Calculate an (approximate) pixel size, based on centimeter size
|
* Calculate an (approximate) pixel size, based on centimeter size
|
||||||
*
|
*
|
||||||
* @param int $sizeInCm Font size (in centimeters)
|
* @param int $sizeInCm Font size (in centimeters)
|
||||||
* @return int Size (in pixels)
|
* @return double Size (in pixels)
|
||||||
*/
|
*/
|
||||||
public static function centimeterSizeToPixels($sizeInCm = 1)
|
public static function centimeterSizeToPixels($sizeInCm = 1)
|
||||||
{
|
{
|
||||||
|
|
@ -51,7 +51,7 @@ class Font
|
||||||
* Convert centimeter to twip
|
* Convert centimeter to twip
|
||||||
*
|
*
|
||||||
* @param int $sizeInCm
|
* @param int $sizeInCm
|
||||||
* @return int
|
* @return double
|
||||||
*/
|
*/
|
||||||
public static function centimeterSizeToTwips($sizeInCm = 1)
|
public static function centimeterSizeToTwips($sizeInCm = 1)
|
||||||
{
|
{
|
||||||
|
|
@ -62,7 +62,7 @@ class Font
|
||||||
* Convert inch to twip
|
* Convert inch to twip
|
||||||
*
|
*
|
||||||
* @param int $sizeInInch
|
* @param int $sizeInInch
|
||||||
* @return int
|
* @return double
|
||||||
*/
|
*/
|
||||||
public static function inchSizeToTwips($sizeInInch = 1)
|
public static function inchSizeToTwips($sizeInInch = 1)
|
||||||
{
|
{
|
||||||
|
|
@ -73,7 +73,7 @@ class Font
|
||||||
* Convert pixel to twip
|
* Convert pixel to twip
|
||||||
*
|
*
|
||||||
* @param int $sizeInPixel
|
* @param int $sizeInPixel
|
||||||
* @return int
|
* @return double
|
||||||
*/
|
*/
|
||||||
public static function pixelSizeToTwips($sizeInPixel = 1)
|
public static function pixelSizeToTwips($sizeInPixel = 1)
|
||||||
{
|
{
|
||||||
|
|
@ -83,8 +83,8 @@ class Font
|
||||||
/**
|
/**
|
||||||
* Calculate twip based on point size, used mainly for paragraph spacing
|
* Calculate twip based on point size, used mainly for paragraph spacing
|
||||||
*
|
*
|
||||||
* @param int|float $sizeInPoint Size in point
|
* @param integer $sizeInPoint Size in point
|
||||||
* @return int|float Size (in twips)
|
* @return integer Size (in twips)
|
||||||
*/
|
*/
|
||||||
public static function pointSizeToTwips($sizeInPoint = 1)
|
public static function pointSizeToTwips($sizeInPoint = 1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,7 @@ class Font
|
||||||
/**
|
/**
|
||||||
* Get foreground/highlight color
|
* Get foreground/highlight color
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getFgColor()
|
public function getFgColor()
|
||||||
{
|
{
|
||||||
|
|
@ -543,7 +543,7 @@ class Font
|
||||||
/**
|
/**
|
||||||
* Get Font Content Type
|
* Get Font Content Type
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getHint()
|
public function getHint()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ class Paragraph
|
||||||
/**
|
/**
|
||||||
* Get Space before Paragraph
|
* Get Space before Paragraph
|
||||||
*
|
*
|
||||||
* @return string
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getSpaceBefore()
|
public function getSpaceBefore()
|
||||||
{
|
{
|
||||||
|
|
@ -210,7 +210,7 @@ class Paragraph
|
||||||
/**
|
/**
|
||||||
* Get Space after Paragraph
|
* Get Space after Paragraph
|
||||||
*
|
*
|
||||||
* @return string
|
* @return integer
|
||||||
*/
|
*/
|
||||||
public function getSpaceAfter()
|
public function getSpaceAfter()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ class Table
|
||||||
/**
|
/**
|
||||||
* Get background
|
* Get background
|
||||||
*
|
*
|
||||||
* @return \PhpOffice\PhpWord\Style\Table
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getBgColor()
|
public function getBgColor()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ namespace PhpOffice\PhpWord\Writer\ODText;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\Exception\Exception;
|
use PhpOffice\PhpWord\Exception\Exception;
|
||||||
use PhpOffice\PhpWord\PhpWord;
|
use PhpOffice\PhpWord\PhpWord;
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ODText manifest part writer
|
* ODText manifest part writer
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
namespace PhpOffice\PhpWord\Writer\ODText;
|
namespace PhpOffice\PhpWord\Writer\ODText;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\PhpWord;
|
use PhpOffice\PhpWord\PhpWord;
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ODText meta part writer
|
* ODText meta part writer
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
namespace PhpOffice\PhpWord\Writer\ODText;
|
namespace PhpOffice\PhpWord\Writer\ODText;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\PhpWord;
|
use PhpOffice\PhpWord\PhpWord;
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
use PhpOffice\PhpWord\Style;
|
use PhpOffice\PhpWord\Style;
|
||||||
use PhpOffice\PhpWord\Style\Font;
|
use PhpOffice\PhpWord\Style\Font;
|
||||||
use PhpOffice\PhpWord\Style\Paragraph;
|
use PhpOffice\PhpWord\Style\Paragraph;
|
||||||
|
|
|
||||||
|
|
@ -1169,7 +1169,6 @@ class Base extends WriterPart
|
||||||
*
|
*
|
||||||
* @param XMLWriter $xmlWriter
|
* @param XMLWriter $xmlWriter
|
||||||
* @param Container $container
|
* @param Container $container
|
||||||
* @param Container $textBreak Add text break when no element found
|
|
||||||
*/
|
*/
|
||||||
protected function writeContainerElements(XMLWriter $xmlWriter, Container $container)
|
protected function writeContainerElements(XMLWriter $xmlWriter, Container $container)
|
||||||
{
|
{
|
||||||
|
|
@ -1224,9 +1223,9 @@ class Base extends WriterPart
|
||||||
* Write margin or border
|
* Write margin or border
|
||||||
*
|
*
|
||||||
* @param XMLWriter $xmlWriter
|
* @param XMLWriter $xmlWriter
|
||||||
* @param boolean $isBorder
|
|
||||||
* @param array $sizes
|
* @param array $sizes
|
||||||
* @param array $colors
|
* @param array $colors
|
||||||
|
* @param array $attributes
|
||||||
*/
|
*/
|
||||||
protected function writeMarginBorder(XMLWriter $xmlWriter, $sizes, $colors = array(), $attributes = array())
|
protected function writeMarginBorder(XMLWriter $xmlWriter, $sizes, $colors = array(), $attributes = array())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
namespace PhpOffice\PhpWord\Writer\Word2007;
|
namespace PhpOffice\PhpWord\Writer\Word2007;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\PhpWord;
|
use PhpOffice\PhpWord\PhpWord;
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Word2007 contenttypes part writer
|
* Word2007 contenttypes part writer
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ use PhpOffice\PhpWord\Container\Section;
|
||||||
use PhpOffice\PhpWord\Element\PageBreak;
|
use PhpOffice\PhpWord\Element\PageBreak;
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
use PhpOffice\PhpWord\Shared\XMLWriter;
|
||||||
use PhpOffice\PhpWord\Style\Font;
|
use PhpOffice\PhpWord\Style\Font;
|
||||||
use PhpOffice\PhpWord\Style\Paragraph;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Word2007 document part writer
|
* Word2007 document part writer
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@
|
||||||
|
|
||||||
namespace PhpOffice\PhpWord\Writer\Word2007;
|
namespace PhpOffice\PhpWord\Writer\Word2007;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\Exception\Exception;
|
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Word2007 document rels part writer
|
* Word2007 document rels part writer
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
namespace PhpOffice\PhpWord\Writer\Word2007;
|
namespace PhpOffice\PhpWord\Writer\Word2007;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\Container\Footer as FooterElement;
|
use PhpOffice\PhpWord\Container\Footer as FooterElement;
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Word2007 footer part writer
|
* Word2007 footer part writer
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,6 @@
|
||||||
namespace PhpOffice\PhpWord\Writer\Word2007;
|
namespace PhpOffice\PhpWord\Writer\Word2007;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\Element\Footnote;
|
use PhpOffice\PhpWord\Element\Footnote;
|
||||||
use PhpOffice\PhpWord\Element\Text;
|
|
||||||
use PhpOffice\PhpWord\Element\Link;
|
|
||||||
use PhpOffice\PhpWord\Element\Image;
|
|
||||||
use PhpOffice\PhpWord\Element\Object;
|
|
||||||
use PhpOffice\PhpWord\Element\TextBreak;
|
|
||||||
use PhpOffice\PhpWord\Style\Paragraph;
|
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
use PhpOffice\PhpWord\Shared\XMLWriter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@
|
||||||
|
|
||||||
namespace PhpOffice\PhpWord\Writer\Word2007;
|
namespace PhpOffice\PhpWord\Writer\Word2007;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\Exception\Exception;
|
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Word2007 footnotes rel part writer
|
* Word2007 footnotes rel part writer
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
namespace PhpOffice\PhpWord\Writer\Word2007;
|
namespace PhpOffice\PhpWord\Writer\Word2007;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\Container\Header as HeaderElement;
|
use PhpOffice\PhpWord\Container\Header as HeaderElement;
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Word2007 header part writer
|
* Word2007 header part writer
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,7 @@
|
||||||
|
|
||||||
namespace PhpOffice\PhpWord\Writer\Word2007;
|
namespace PhpOffice\PhpWord\Writer\Word2007;
|
||||||
|
|
||||||
use PhpOffice\PhpWord\Exception\Exception;
|
|
||||||
use PhpOffice\PhpWord\PhpWord;
|
use PhpOffice\PhpWord\PhpWord;
|
||||||
use PhpOffice\PhpWord\Shared\XMLWriter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Word2007 rels part writer
|
* Word2007 rels part writer
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue