getStyle(); if (!$style instanceof \PhpOffice\PhpWord\Style\Fill) { return; } $xmlWriter = $this->getXmlWriter(); $xmlWriter->writeAttribute('on', 't'); $xmlWriter->writeAttributeIf($style->getColor() !== null, 'fillcolor', $style->getColor()); } }