Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PCLZIP alternative to ZipArchive (merged from #140) #185

Merged
merged 13 commits into from
Mar 30, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor writer classes
  • Loading branch information
ivanlanin committed Mar 30, 2014
commit 45b0baf7bce599571780b2f9bda21fd32879f442
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
{
"name": "Ivan Lanin",
"homepage": "https://ivan.lanin.org"
},
{
"name": "Roman Syroeshko",
"homepage": "https://ru.linkedin.com/pub/roman-syroeshko/34/a53/994/"
}
],
"require": {
Expand Down
12 changes: 3 additions & 9 deletions src/PhpWord/DocumentProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ class DocumentProperties
/**
* Created
*
* @var datetime
* @var datetime|int
*/
private $_created;

/**
* Modified
*
* @var datetime
* @var datetime|int
*/
private $_modified;

Expand Down Expand Up @@ -102,7 +102,7 @@ class DocumentProperties
/**
* Custom Properties
*
* @var string
* @var array
*/
private $_customProperties = array();

Expand Down Expand Up @@ -542,26 +542,21 @@ public static function convertPropertyType($propertyType)
case 'ui8': // 8-Byte Unsigned Integer
case 'uint': // Unsigned Integer
return self::PROPERTY_TYPE_INTEGER;
break;
case 'r4': // 4-Byte Real Number
case 'r8': // 8-Byte Real Number
case 'decimal': // Decimal
return self::PROPERTY_TYPE_FLOAT;
break;
case 'empty': // Empty
case 'null': // Null
case 'lpstr': // LPSTR
case 'lpwstr': // LPWSTR
case 'bstr': // Basic String
return self::PROPERTY_TYPE_STRING;
break;
case 'date': // Date and Time
case 'filetime': // File Time
return self::PROPERTY_TYPE_DATE;
break;
case 'bool': // Boolean
return self::PROPERTY_TYPE_BOOLEAN;
break;
case 'cy': // Currency
case 'error': // Error Status Code
case 'vector': // Vector
Expand All @@ -576,7 +571,6 @@ public static function convertPropertyType($propertyType)
case 'clsid': // Class ID
case 'cf': // Clipboard Data
return self::PROPERTY_TYPE_UNKNOWN;
break;
}
return self::PROPERTY_TYPE_UNKNOWN;
}
Expand Down
22 changes: 11 additions & 11 deletions src/PhpWord/Section/CheckBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ class CheckBox
/**
* Text style
*
* @var Font
* @var string|Font
*/
private $fontStyle;

/**
* Paragraph style
*
* @var Paragraph
* @var string|Paragraph
*/
private $paragraphStyle;

Expand All @@ -50,8 +50,8 @@ class CheckBox
*
* @param string $name
* @param string $text
* @param Font $fontStyle
* @param Paragraph $paragraphStyle
* @param mixed $fontStyle
* @param mixed $paragraphStyle
*/
public function __construct($name = null, $text = null, $fontStyle = null, $paragraphStyle = null)
{
Expand All @@ -66,9 +66,9 @@ public function __construct($name = null, $text = null, $fontStyle = null, $para
/**
* Set Text style
*
* @param Font $style
* @param Paragraph $paragraphStyle
* @return Font
* @param mixed $style
* @param mixed $paragraphStyle
* @return string|Font
*/
public function setFontStyle($style = null, $paragraphStyle = null)
{
Expand All @@ -90,7 +90,7 @@ public function setFontStyle($style = null, $paragraphStyle = null)
/**
* Get Text style
*
* @return Font
* @return string|Font
*/
public function getFontStyle()
{
Expand All @@ -100,8 +100,8 @@ public function getFontStyle()
/**
* Set Paragraph style
*
* @param Paragraph $style
* @return Paragraph
* @param mixed $style
* @return string|Paragraph
*/
public function setParagraphStyle($style = null)
{
Expand All @@ -121,7 +121,7 @@ public function setParagraphStyle($style = null)
/**
* Get Paragraph style
*
* @return Paragraph
* @return string|Paragraph
*/
public function getParagraphStyle()
{
Expand Down
10 changes: 5 additions & 5 deletions src/PhpWord/Section/Footer/PreserveText.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class PreserveText
/**
* Text style
*
* @var \PhpOffice\PhpWord\Style\Font
* @var string|Font
*/
private $_styleFont;

/**
* Paragraph style
*
* @var \PhpOffice\PhpWord\Style\Paragraph
* @var string|Paragraph
*/
private $_styleParagraph;

Expand All @@ -45,7 +45,7 @@ class PreserveText
* @param string $text
* @param mixed $styleFont
* @param mixed $styleParagraph
* @return PHPWord_Section_Footer_PreserveText
* @return $this
*/
public function __construct($text = null, $styleFont = null, $styleParagraph = null)
{
Expand Down Expand Up @@ -88,7 +88,7 @@ public function __construct($text = null, $styleFont = null, $styleParagraph = n
/**
* Get Text style
*
* @return \PhpOffice\PhpWord\Style\Font
* @return string|Font
*/
public function getFontStyle()
{
Expand All @@ -98,7 +98,7 @@ public function getFontStyle()
/**
* Get Paragraph style
*
* @return \PhpOffice\PhpWord\Style\Paragraph
* @return string|Paragraph
*/
public function getParagraphStyle()
{
Expand Down
8 changes: 4 additions & 4 deletions src/PhpWord/Section/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class Link
/**
* Link style
*
* @var \PhpOffice\PhpWord\Style\Font
* @var string|Font
*/
private $_styleFont;

/**
* Paragraph style
*
* @var \PhpOffice\PhpWord\Style\Paragraph
* @var string|Paragraph
*/
private $_styleParagraph;

Expand Down Expand Up @@ -140,7 +140,7 @@ public function getLinkName()
/**
* Get Text style
*
* @return \PhpOffice\PhpWord\Style\Font
* @return string|Font
*/
public function getFontStyle()
{
Expand All @@ -150,7 +150,7 @@ public function getFontStyle()
/**
* Get Paragraph style
*
* @return \PhpOffice\PhpWord\Style\Paragraph
* @return string|Paragraph
*/
public function getParagraphStyle()
{
Expand Down
22 changes: 11 additions & 11 deletions src/PhpWord/Section/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ class Text
/**
* Text style
*
* @var \PhpOffice\PhpWord\Style\Font
* @var string|Font
*/
private $fontStyle;

/**
* Paragraph style
*
* @var \PhpOffice\PhpWord\Style\Paragraph
* @var string|Paragraph
*/
private $paragraphStyle;

/**
* Create a new Text Element
*
* @param string $text
* @param null|array|\PhpOffice\PhpWord\Style\Font $fontStyle
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
* @param mixed $fontStyle
* @param mixed $paragraphStyle
*/
public function __construct($text = null, $fontStyle = null, $paragraphStyle = null)
{
Expand All @@ -55,9 +55,9 @@ public function __construct($text = null, $fontStyle = null, $paragraphStyle = n
/**
* Set Text style
*
* @param null|array|\PhpOffice\PhpWord\Style\Font $style
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
* @return \PhpOffice\PhpWord\Style\Font
* @param string|array|Font $style
* @param string|array|Paragraph $paragraphStyle
* @return string|Font
*/
public function setFontStyle($style = null, $paragraphStyle = null)
{
Expand All @@ -79,7 +79,7 @@ public function setFontStyle($style = null, $paragraphStyle = null)
/**
* Get Text style
*
* @return \PhpOffice\PhpWord\Style\Font
* @return string|Font
*/
public function getFontStyle()
{
Expand All @@ -89,8 +89,8 @@ public function getFontStyle()
/**
* Set Paragraph style
*
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $style
* @return null|\PhpOffice\PhpWord\Style\Paragraph
* @param string|array|Paragraph $style
* @return string|Paragraph
*/
public function setParagraphStyle($style = null)
{
Expand All @@ -110,7 +110,7 @@ public function setParagraphStyle($style = null)
/**
* Get Paragraph style
*
* @return \PhpOffice\PhpWord\Style\Paragraph
* @return string|Paragraph
*/
public function getParagraphStyle()
{
Expand Down
18 changes: 9 additions & 9 deletions src/PhpWord/Section/TextBreak.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class TextBreak
/**
* Paragraph style
*
* @var \PhpOffice\PhpWord\Style\Pagaraph
* @var string|Paragraph
*/
private $paragraphStyle = null;

/**
* Text style
*
* @var \PhpOffice\PhpWord\Style\Font
* @var string|Font
*/
private $fontStyle = null;

Expand All @@ -50,9 +50,9 @@ public function __construct($fontStyle = null, $paragraphStyle = null)
/**
* Set Text style
*
* @param null|array|\PhpOffice\PhpWord\Style\Font $style
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
* @return \PhpOffice\PhpWord\Style\Font
* @param mixed $style
* @param mixed $paragraphStyle
* @return string|Font
*/
public function setFontStyle($style = null, $paragraphStyle = null)
{
Expand All @@ -72,7 +72,7 @@ public function setFontStyle($style = null, $paragraphStyle = null)
/**
* Get Text style
*
* @return \PhpOffice\PhpWord\Style\Font
* @return string|Font
*/
public function getFontStyle()
{
Expand All @@ -82,8 +82,8 @@ public function getFontStyle()
/**
* Set Paragraph style
*
* @param null|array|\PhpOffice\PhpWord\Style\Paragraph $style
* @return null|\PhpOffice\PhpWord\Style\Paragraph
* @param string|array|Paragraph $style
* @return string|Paragraph
*/
public function setParagraphStyle($style = null)
{
Expand All @@ -101,7 +101,7 @@ public function setParagraphStyle($style = null)
/**
* Get Paragraph style
*
* @return \PhpOffice\PhpWord\Style\Paragraph
* @return string|Paragraph
*/
public function getParagraphStyle()
{
Expand Down
9 changes: 5 additions & 4 deletions src/PhpWord/Section/TextRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use PhpOffice\PhpWord\Exceptions\InvalidImageException;
use PhpOffice\PhpWord\Media;
use PhpOffice\PhpWord\Shared\String;
use PhpOffice\PhpWord\Style\Font;
use PhpOffice\PhpWord\Style\Paragraph;

/**
Expand All @@ -22,7 +23,7 @@ class TextRun
/**
* Paragraph style
*
* @var \PhpOffice\PhpWord\Style\Paragraph
* @var Paragraph
*/
private $_styleParagraph;

Expand Down Expand Up @@ -123,8 +124,8 @@ public function addImage($imageSrc, $style = null)
* Add TextBreak
*
* @param int $count
* @param null|string|array|\PhpOffice\PhpWord\Style\Font $fontStyle
* @param null|string|array|\PhpOffice\PhpWord\Style\Paragraph $paragraphStyle
* @param mixed $fontStyle
* @param mixed $paragraphStyle
*/
public function addTextBreak($count = 1, $fontStyle = null, $paragraphStyle = null)
{
Expand Down Expand Up @@ -161,7 +162,7 @@ public function getElements()
/**
* Get Paragraph style
*
* @return \PhpOffice\PhpWord\Style\Paragraph
* @return string|Paragraph
*/
public function getParagraphStyle()
{
Expand Down
4 changes: 2 additions & 2 deletions src/PhpWord/Style/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,8 @@ public function getBgColor()
/**
* Set background color
*
* @param string $pValue
* @return PHPWord_Style_Font
* @param string $pValue
* @return $this
*/
public function setBgColor($pValue = null)
{
Expand Down
Loading