From f73beaa26a90ece5eab8015b2127347fd35076f2 Mon Sep 17 00:00:00 2001 From: troosan Date: Mon, 19 Mar 2018 23:06:00 +0100 Subject: [PATCH] reset static collections at instantiation --- src/PhpWord/PhpWord.php | 13 +++++++++++++ tests/PhpWord/Shared/HtmlTest.php | 4 ++-- tests/PhpWord/Style/TablePositionTest.php | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/PhpWord/PhpWord.php b/src/PhpWord/PhpWord.php index 6b6fd9ff..d524adc7 100644 --- a/src/PhpWord/PhpWord.php +++ b/src/PhpWord/PhpWord.php @@ -52,8 +52,17 @@ class PhpWord * @const string|int */ const DEFAULT_FONT_NAME = Settings::DEFAULT_FONT_NAME; + /** + * @deprecated 0.11.0 Use Settings constants + */ const DEFAULT_FONT_SIZE = Settings::DEFAULT_FONT_SIZE; + /** + * @deprecated 0.11.0 Use Settings constants + */ const DEFAULT_FONT_COLOR = Settings::DEFAULT_FONT_COLOR; + /** + * @deprecated 0.11.0 Use Settings constants + */ const DEFAULT_FONT_CONTENT_TYPE = Settings::DEFAULT_FONT_CONTENT_TYPE; /** @@ -85,6 +94,10 @@ class PhpWord */ public function __construct() { + // Reset Media and styles + Media::resetStyles(); + Style::resetStyles(); + // Collection $collections = array('Bookmarks', 'Titles', 'Footnotes', 'Endnotes', 'Charts', 'Comments'); foreach ($collections as $collection) { diff --git a/tests/PhpWord/Shared/HtmlTest.php b/tests/PhpWord/Shared/HtmlTest.php index 386aaee1..1171489c 100644 --- a/tests/PhpWord/Shared/HtmlTest.php +++ b/tests/PhpWord/Shared/HtmlTest.php @@ -19,9 +19,9 @@ namespace PhpOffice\PhpWord\Shared; use PhpOffice\PhpWord\Element\Section; use PhpOffice\PhpWord\SimpleType\Jc; -use PhpOffice\PhpWord\TestHelperDOCX; -use PhpOffice\PhpWord\Style\Paragraph; use PhpOffice\PhpWord\SimpleType\LineSpacingRule; +use PhpOffice\PhpWord\Style\Paragraph; +use PhpOffice\PhpWord\TestHelperDOCX; /** * Test class for PhpOffice\PhpWord\Shared\Html diff --git a/tests/PhpWord/Style/TablePositionTest.php b/tests/PhpWord/Style/TablePositionTest.php index 77b22e4e..1243c3d5 100644 --- a/tests/PhpWord/Style/TablePositionTest.php +++ b/tests/PhpWord/Style/TablePositionTest.php @@ -11,7 +11,7 @@ * contributors, visit https://github.com/PHPOffice/PHPWord/contributors. * * @see https://github.com/PHPOffice/PHPWord - * @copyright 2010-2017 PHPWord contributors + * @copyright 2010-2018 PHPWord contributors * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3 */