Skip to content

Commit c3c93c5

Browse files
committed
Fix CI
1 parent 69f6334 commit c3c93c5

File tree

5 files changed

+26
-21
lines changed

5 files changed

+26
-21
lines changed

phpstan-baseline.neon

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5757,7 +5757,7 @@ parameters:
57575757

57585758
-
57595759
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#"
5760-
count: 4
5760+
count: 5
57615761
path: src/PhpSpreadsheet/Writer/Xlsx/StringTable.php
57625762

57635763
-
@@ -5852,9 +5852,14 @@ parameters:
58525852

58535853
-
58545854
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#"
5855-
count: 4
5855+
count: 9
58565856
path: src/PhpSpreadsheet/Writer/Xlsx/Style.php
58575857

5858+
-
5859+
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, string\\|null given\\.$#"
5860+
count: 1
5861+
path: src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
5862+
58585863
-
58595864
message: "#^Parameter \\#2 \\$value of method XMLWriter\\:\\:writeAttribute\\(\\) expects string, float given\\.$#"
58605865
count: 1

src/PhpSpreadsheet/Reader/Ods.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public function canRead(string $filename): bool
5656
$mimeType = $zip->getFromName($stat['name']);
5757
} elseif ($zip->statName('META-INF/manifest.xml')) {
5858
$xml = simplexml_load_string(
59-
$this->securityScanner->scan($zip->getFromName('META-INF/manifest.xml')),
60-
'SimpleXMLElement',
61-
Settings::getLibXmlLoaderOptions()
62-
);
59+
$this->securityScanner->scan($zip->getFromName('META-INF/manifest.xml')),
60+
'SimpleXMLElement',
61+
Settings::getLibXmlLoaderOptions()
62+
);
6363
$namespacesContent = $xml->getNamespaces(true);
6464
if (isset($namespacesContent['manifest'])) {
6565
$manifest = $xml->children($namespacesContent['manifest']);

src/PhpSpreadsheet/Reader/Xls.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,19 +1154,19 @@ public function load(string $filename, int $flags = 0)
11541154
$drawing->setOffsetY($offsetY);
11551155

11561156
switch ($blipType) {
1157-
case BSE::BLIPTYPE_JPEG:
1158-
$drawing->setRenderingFunction(MemoryDrawing::RENDERING_JPEG);
1159-
$drawing->setMimeType(MemoryDrawing::MIMETYPE_JPEG);
1157+
case BSE::BLIPTYPE_JPEG:
1158+
$drawing->setRenderingFunction(MemoryDrawing::RENDERING_JPEG);
1159+
$drawing->setMimeType(MemoryDrawing::MIMETYPE_JPEG);
11601160

1161-
break;
1162-
case BSE::BLIPTYPE_PNG:
1161+
break;
1162+
case BSE::BLIPTYPE_PNG:
11631163
imagealphablending($ih, false);
11641164
imagesavealpha($ih, true);
1165-
$drawing->setRenderingFunction(MemoryDrawing::RENDERING_PNG);
1166-
$drawing->setMimeType(MemoryDrawing::MIMETYPE_PNG);
1165+
$drawing->setRenderingFunction(MemoryDrawing::RENDERING_PNG);
1166+
$drawing->setMimeType(MemoryDrawing::MIMETYPE_PNG);
11671167

1168-
break;
1169-
}
1168+
break;
1169+
}
11701170

11711171
$drawing->setWorksheet($this->phpSheet);
11721172
$drawing->setCoordinates($spContainer->getStartCoordinates());

src/PhpSpreadsheet/Style/Color.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Color extends Supervisor
4141
/**
4242
* ARGB - Alpha RGB.
4343
*
44-
* @var string
44+
* @var null|string
4545
*/
4646
protected $argb;
4747

@@ -135,7 +135,7 @@ private function validateColor(string $colorValue, int $size): bool
135135
/**
136136
* Get ARGB.
137137
*/
138-
public function getARGB(): string
138+
public function getARGB(): ?string
139139
{
140140
if ($this->isSupervisor) {
141141
return $this->getSharedComponent()->getARGB();

src/PhpSpreadsheet/Writer/Html.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -698,10 +698,10 @@ private function writeImageInCell(Worksheet $worksheet, $coordinates)
698698
if ($imageResource) {
699699
ob_start(); // Let's start output buffering.
700700
imagepng($imageResource); // This will normally output the image, but because of ob_start(), it won't.
701-
$contents = ob_get_contents(); // Instead, output above is saved to $contents
702-
ob_end_clean(); // End the output buffer.
701+
$contents = ob_get_contents(); // Instead, output above is saved to $contents
702+
ob_end_clean(); // End the output buffer.
703703

704-
$dataUri = 'data:image/jpeg;base64,' . base64_encode($contents);
704+
$dataUri = 'data:image/jpeg;base64,' . base64_encode($contents);
705705

706706
// Because of the nature of tables, width is more important than height.
707707
// max-width: 100% ensures that image doesnt overflow containing cell
@@ -1296,7 +1296,7 @@ private function generateRowCellDataValue(Worksheet $worksheet, $cell, &$cellDat
12961296
} else {
12971297
$origData = $this->preCalculateFormulas ? $cell->getCalculatedValue() : $cell->getValue();
12981298
$formatCode = $worksheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode();
1299-
if ($formatCode) {
1299+
if ($formatCode !== null) {
13001300
$cellData = NumberFormat::toFormattedString(
13011301
$origData,
13021302
$formatCode,

0 commit comments

Comments
 (0)