Skip to content

Commit 689a737

Browse files
committed
Fix Travis errors
1 parent 2d351c9 commit 689a737

File tree

1 file changed

+4
-1
lines changed
  • src/PhpWord/Writer/Word2007/Element

1 file changed

+4
-1
lines changed

src/PhpWord/Writer/Word2007/Element/SDT.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*
2626
* @since 0.12.0
2727
* @link http://www.datypic.com/sc/ooxml/t-w_CT_SdtBlock.html
28+
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
2829
*/
2930
class SDT extends Text
3031
{
@@ -100,7 +101,9 @@ private function writeDropDownList(XMLWriter $xmlWriter, SDTElement $element)
100101
*/
101102
private function writeDate(XMLWriter $xmlWriter, SDTElement $element)
102103
{
103-
$xmlWriter->startElement("w:date");
104+
$type = $element->getType();
105+
106+
$xmlWriter->startElement("w:{$type}");
104107
$xmlWriter->writeElementBlock('w:dateFormat', 'w:val', 'd/M/yyyy');
105108
$xmlWriter->writeElementBlock('w:lid', 'w:val', 'en-US');
106109
$xmlWriter->writeElementBlock('w:storeMappedDataAs', 'w:val', 'dateTime');

0 commit comments

Comments
 (0)