← All changes
|
libraries/vendor/PhpSpreadsheet/Reader/Xlsx/ConditionalStyles.php
+5
-2
3.3.1
→
3.4
View file →
| @@ -301,9 +301,9 @@ | ||
| 301 | 301 | //dataBar children |
| 302 | 302 | //conditionalFormatValueObjects |
| 303 | 303 | $cfvoXml = $cfRule->dataBar->cfvo; |
| 304 | 304 | $cfvoIndex = 0; |
| 305 | - foreach ((count($cfvoXml) > 1 ? $cfvoXml : [$cfvoXml]) as $cfvo) { //* @phpstan-ignore-line | |
| 305 | + foreach ((count($cfvoXml) > 1 ? $cfvoXml : [$cfvoXml]) as $cfvo) { //* @phpstan-ignore foreach.nonIterable (I don't know how to fix this) | |
| 306 | 306 | /** @var SimpleXMLElement $cfvo */ |
| 307 | 307 | if ($cfvoIndex === 0) { |
| 308 | 308 | $dataBar->setMinimumConditionalFormatValueObject(new ConditionalFormatValueObject((string) $cfvo['type'], (string) $cfvo['val'])); |
| 309 | 309 | } |
| @@ -335,8 +335,11 @@ | ||
| 335 | 335 | foreach ($cfRule->colorScale->cfvo as $cfvoXml) { |
| 336 | 336 | $attr = $cfvoXml->attributes() ?? []; |
| 337 | 337 | $type = (string) ($attr['type'] ?? ''); |
| 338 | 338 | $val = $attr['val'] ?? null; |
| 339 | + if ($val instanceof SimpleXMLElement) { | |
| 340 | + $val = (string) $val; | |
| 341 | + } | |
| 339 | 342 | if ($idx === 0) { |
| 340 | 343 | $method = 'setMinimumConditionalFormatValueObject'; |
| 341 | 344 | } elseif ($idx === 1 && $count === 3) { |
| 342 | 345 | $method = 'setMidpointConditionalFormatValueObject'; |
| @@ -404,9 +407,9 @@ | ||
| 404 | 407 | private function readDataBarExtLstOfConditionalRule(ConditionalDataBar $dataBar, SimpleXMLElement $cfRule, array $conditionalFormattingRuleExtensions): void |
| 405 | 408 | { |
| 406 | 409 | if (isset($cfRule->extLst)) { |
| 407 | 410 | $ns = $cfRule->extLst->getNamespaces(true); |
| 408 | - foreach ((count($cfRule->extLst) > 0 ? $cfRule->extLst->ext : [$cfRule->extLst->ext]) as $ext) { //* @phpstan-ignore-line | |
| 411 | + foreach ((count($cfRule->extLst) > 0 ? $cfRule->extLst->ext : [$cfRule->extLst->ext]) as $ext) { //* @phpstan-ignore foreach.nonIterable (I don't know how to fix this) | |
| 409 | 412 | /** @var SimpleXMLElement $ext */ |
| 410 | 413 | $extId = (string) $ext->children($ns['x14'])->id; |
| 411 | 414 | if (isset($conditionalFormattingRuleExtensions[$extId]) && (string) $ext['uri'] === '{B025F937-C7B1-47D3-B67F-A62EFF666E3E}') { |
| 412 | 415 | $dataBar->setConditionalFormattingRuleExt($conditionalFormattingRuleExtensions[$extId]); |