Fix deprecated warning for non-hexadecimal number

I've come across this deprecated warning when trying to save docx to pdf.. if cellBgColor is set to `auto` it should be converted back to `null` which has in practice the same functionality.
This commit is contained in:
Ciki 2020-12-22 12:12:18 +01:00 committed by GitHub
parent ec1b3d35ee
commit 1f67c993e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -52,6 +52,7 @@ class Table extends AbstractElement
for ($j = 0; $j < $rowCellCount; $j++) {
$cellStyle = $rowCells[$j]->getStyle();
$cellBgColor = $cellStyle->getBgColor();
$cellBgColor === 'auto' && $cellBgColor = null; // Fix deprecated warning for non-hexadecimal number
$cellFgColor = null;
if ($cellBgColor) {
$red = hexdec(substr($cellBgColor, 0, 2));