18 if (!isset(
$xml->Styles)) {
30 $styleID = (string) $style_ss[
'ID'];
31 $this->styles[$styleID] = $this->styles[
'Default'] ?? [];
33 $alignment =
$border = $font = $fill = $numberFormat = [];
35 foreach (
$style as $styleType => $styleDatax) {
36 $styleData = $styleDatax ??
new SimpleXMLElement(
'<xml></xml>');
37 $styleAttributes = $styleData->attributes($namespaces[
'ss']);
40 $alignment = $alignmentStyleParser->parseStyle($styleAttributes);
44 $border = $borderStyleParser->parseStyle($styleData, $namespaces);
48 $font = $fontStyleParser->parseStyle($styleAttributes);
52 $fill = $fillStyleParser->parseStyle($styleAttributes);
56 $numberFormat = $numberFormatStyleParser->parseStyle($styleAttributes);
62 $this->styles[$styleID] = array_merge($alignment,
$border, $font, $fill, $numberFormat);
68 protected static function getAttributes(?SimpleXMLElement $simple,
string $node): SimpleXMLElement
70 return ($simple ===
null)
71 ?
new SimpleXMLElement(
'<xml></xml>')
72 : ($simple->attributes($node) ??
new SimpleXMLElement(
'<xml></xml>'));
An exception for terminatinating execution or to throw for unit testing.
static getAttributes(?SimpleXMLElement $simple, string $node)
parseStyles(SimpleXMLElement $xml, array $namespaces)