Skip to content

Commit f73beaa

Browse files
committed
reset static collections at instantiation
1 parent 16a9ded commit f73beaa

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

src/PhpWord/PhpWord.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,17 @@ class PhpWord
5252
* @const string|int
5353
*/
5454
const DEFAULT_FONT_NAME = Settings::DEFAULT_FONT_NAME;
55+
/**
56+
* @deprecated 0.11.0 Use Settings constants
57+
*/
5558
const DEFAULT_FONT_SIZE = Settings::DEFAULT_FONT_SIZE;
59+
/**
60+
* @deprecated 0.11.0 Use Settings constants
61+
*/
5662
const DEFAULT_FONT_COLOR = Settings::DEFAULT_FONT_COLOR;
63+
/**
64+
* @deprecated 0.11.0 Use Settings constants
65+
*/
5766
const DEFAULT_FONT_CONTENT_TYPE = Settings::DEFAULT_FONT_CONTENT_TYPE;
5867

5968
/**
@@ -85,6 +94,10 @@ class PhpWord
8594
*/
8695
public function __construct()
8796
{
97+
// Reset Media and styles
98+
Media::resetStyles();
99+
Style::resetStyles();
100+
88101
// Collection
89102
$collections = array('Bookmarks', 'Titles', 'Footnotes', 'Endnotes', 'Charts', 'Comments');
90103
foreach ($collections as $collection) {

tests/PhpWord/Shared/HtmlTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
use PhpOffice\PhpWord\Element\Section;
2121
use PhpOffice\PhpWord\SimpleType\Jc;
22-
use PhpOffice\PhpWord\TestHelperDOCX;
23-
use PhpOffice\PhpWord\Style\Paragraph;
2422
use PhpOffice\PhpWord\SimpleType\LineSpacingRule;
23+
use PhpOffice\PhpWord\Style\Paragraph;
24+
use PhpOffice\PhpWord\TestHelperDOCX;
2525

2626
/**
2727
* Test class for PhpOffice\PhpWord\Shared\Html

tests/PhpWord/Style/TablePositionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
1212
*
1313
* @see https://github.com/PHPOffice/PHPWord
14-
* @copyright 2010-2017 PHPWord contributors
14+
* @copyright 2010-2018 PHPWord contributors
1515
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
1616
*/
1717

0 commit comments

Comments
 (0)