Skip to content

Commit f359825

Browse files
author
Roman Syroeshko
committed
Reviewed and merged #658.
1 parent 5781f65 commit f359825

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+162
-1259
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,17 @@ Use the correspondent `getAlignment` and `setAlignment` methods instead. - @Roma
2525
- `left`, `right`, and `justify` alignment options for tables (now are mapped to `Jc::START`, `Jc::END`, and `Jc::CENTER`). - @RomanSyroeshko
2626

2727
### Removed
28-
- `PhpOffice\PhpWord\Style\Alignment`. Style properties, which previously stored instances of this class, now deal with strings.
28+
- `\PhpOffice\PhpWord\Style\Alignment`. Style properties, which previously stored instances of this class, now deal with strings.
2929
In each case set of available string values is defined by the correspondent simple type. - @RomanSyroeshko
3030
- Manual installation support. Since the release we have dependencies on third party libraries,
3131
so installation via ZIP-archive download is not an option anymore. To install PHPWord use [Composer](https://getcomposer.org/).
32-
We also removed `PhpOffice\PhpWord\Autoloader`, because the latter change made it completely useless.
32+
We also removed `\PhpOffice\PhpWord\Autoloader`, because the latter change made it completely useless.
3333
Autoloaders provided by Composer are in use now (see `bootstrap.php`). - @RomanSyroeshko
34+
- `\PhpOffice\PhpWord\Shared\Drawing` replaced by `\PhpOffice\Common\Drawing`. - @Progi1984 #658
35+
- `\PhpOffice\PhpWord\Shared\Font`. - @Progi1984 #658
36+
- `\PhpOffice\PhpWord\Shared\String` replaced by `\PhpOffice\Common\Text`. - @Progi1984 @RomanSyroeshko #658
37+
- `\PhpOffice\PhpWord\Shared\XMLReader` replaced by `\PhpOffice\Common\XMLReader`. - @Progi1984 #658
38+
- `\PhpOffice\PhpWord\Shared\XMLWriter` replaced by `\PhpOffice\Common\XMLWriter`. - @Progi1984 @RomanSyroeshko #658
3439

3540

3641

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
"require": {
3535
"php": ">=5.3.3",
3636
"ext-xml": "*",
37-
"zendframework/zend-validator": "2.5.*"
37+
"zendframework/zend-validator": "2.5.*",
38+
"zendframework/zend-stdlib": "~2.5",
39+
"phpoffice/common": "0.2.*"
3840
},
3941
"require-dev": {
4042
"phpunit/phpunit": "3.7.*",
@@ -43,9 +45,11 @@
4345
"phpmd/phpmd": "2.*",
4446
"phploc/phploc": "2.*",
4547
"dompdf/dompdf":"0.6.*",
46-
"tecnick.com/tcpdf": "6.*",
48+
"tecnickcom/tcpdf": "6.*",
4749
"mpdf/mpdf": "5.*",
48-
"zendframework/zend-validator": "2.5.*"
50+
"zendframework/zend-validator": "2.5.*",
51+
"zendframework/zend-stdlib": "~2.5",
52+
"phpoffice/common": "0.2.*"
4953
},
5054
"suggest": {
5155
"ext-zip": "Allows writing DOCX and ODT",

src/PhpWord/Element/Bookmark.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace PhpOffice\PhpWord\Element;
1919

20-
use PhpOffice\PhpWord\Shared\String;
20+
use PhpOffice\Common\Text as CommonText;
2121
use PhpOffice\PhpWord\Style;
2222

2323
/**
@@ -47,7 +47,7 @@ class Bookmark extends AbstractElement
4747
public function __construct($name)
4848
{
4949

50-
$this->name = String::toUTF8($name);
50+
$this->name = CommonText::toUTF8($name);
5151
return $this;
5252
}
5353

src/PhpWord/Element/CheckBox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace PhpOffice\PhpWord\Element;
1919

20-
use PhpOffice\PhpWord\Shared\String;
20+
use PhpOffice\Common\Text as CommonText;
2121

2222
/**
2323
* Check box element
@@ -56,7 +56,7 @@ public function __construct($name = null, $text = null, $fontStyle = null, $para
5656
*/
5757
public function setName($name)
5858
{
59-
$this->name = String::toUTF8($name);
59+
$this->name = CommonText::toUTF8($name);
6060

6161
return $this;
6262
}

src/PhpWord/Element/Link.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace PhpOffice\PhpWord\Element;
1919

20-
use PhpOffice\PhpWord\Shared\String;
20+
use PhpOffice\Common\Text as CommonText;
2121
use PhpOffice\PhpWord\Style\Font;
2222
use PhpOffice\PhpWord\Style\Paragraph;
2323

@@ -78,8 +78,8 @@ class Link extends AbstractElement
7878
*/
7979
public function __construct($source, $text = null, $fontStyle = null, $paragraphStyle = null, $internal = false)
8080
{
81-
$this->source = String::toUTF8($source);
82-
$this->text = is_null($text) ? $this->source : String::toUTF8($text);
81+
$this->source = CommonText::toUTF8($source);
82+
$this->text = is_null($text) ? $this->source : CommonText::toUTF8($text);
8383
$this->fontStyle = $this->setNewStyle(new Font('text'), $fontStyle);
8484
$this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle);
8585
$this->internal = $internal;

src/PhpWord/Element/ListItem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace PhpOffice\PhpWord\Element;
1919

20-
use PhpOffice\PhpWord\Shared\String;
20+
use PhpOffice\Common\Text as CommonText;
2121
use PhpOffice\PhpWord\Style\ListItem as ListItemStyle;
2222

2323
/**
@@ -57,7 +57,7 @@ class ListItem extends AbstractElement
5757
*/
5858
public function __construct($text, $depth = 0, $fontStyle = null, $listStyle = null, $paragraphStyle = null)
5959
{
60-
$this->textObject = new Text(String::toUTF8($text), $fontStyle, $paragraphStyle);
60+
$this->textObject = new Text(CommonText::toUTF8($text), $fontStyle, $paragraphStyle);
6161
$this->depth = $depth;
6262

6363
// Version >= 0.10.0 will pass numbering style name. Older version will use old method

src/PhpWord/Element/PreserveText.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace PhpOffice\PhpWord\Element;
1919

20-
use PhpOffice\PhpWord\Shared\String;
20+
use PhpOffice\Common\Text as CommonText;
2121
use PhpOffice\PhpWord\Style\Font;
2222
use PhpOffice\PhpWord\Style\Paragraph;
2323

@@ -61,7 +61,7 @@ public function __construct($text = null, $fontStyle = null, $paragraphStyle = n
6161
$this->fontStyle = $this->setNewStyle(new Font('text'), $fontStyle);
6262
$this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle);
6363

64-
$this->text = String::toUTF8($text);
64+
$this->text = CommonText::toUTF8($text);
6565
$matches = preg_split('/({.*?})/', $this->text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
6666
if (isset($matches[0])) {
6767
$this->text = $matches;

src/PhpWord/Element/Text.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace PhpOffice\PhpWord\Element;
1919

20-
use PhpOffice\PhpWord\Shared\String;
20+
use PhpOffice\Common\Text as CommonText;
2121
use PhpOffice\PhpWord\Style\Font;
2222
use PhpOffice\PhpWord\Style\Paragraph;
2323

@@ -136,7 +136,7 @@ public function getParagraphStyle()
136136
*/
137137
public function setText($text)
138138
{
139-
$this->text = String::toUTF8($text);
139+
$this->text = CommonText::toUTF8($text);
140140

141141
return $this;
142142
}

src/PhpWord/Element/Title.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace PhpOffice\PhpWord\Element;
1919

20-
use PhpOffice\PhpWord\Shared\String;
20+
use PhpOffice\Common\Text as CommonText;
2121
use PhpOffice\PhpWord\Style;
2222

2323
/**
@@ -61,7 +61,7 @@ class Title extends AbstractElement
6161
*/
6262
public function __construct($text, $depth = 1)
6363
{
64-
$this->text = String::toUTF8($text);
64+
$this->text = CommonText::toUTF8($text);
6565
$this->depth = $depth;
6666
if (array_key_exists("Heading_{$this->depth}", Style::getStyles())) {
6767
$this->style = "Heading{$this->depth}";

src/PhpWord/Reader/MsDoc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
namespace PhpOffice\PhpWord\Reader;
1919

20+
use PhpOffice\Common\Drawing;
2021
use PhpOffice\PhpWord\PhpWord;
21-
use PhpOffice\PhpWord\Shared\Drawing;
2222
use PhpOffice\PhpWord\Shared\OLERead;
2323
use PhpOffice\PhpWord\Style;
2424

0 commit comments

Comments
 (0)