18 if (!isset($xml->Styles)) {
28 foreach ($xml->Styles[0] as
$style) {
29 $style_ss = self::getAttributes($style, $namespaces[
'ss']);
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) {
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);
70 return ($simple === null)
parseStyles(SimpleXMLElement $xml, array $namespaces)
static getAttributes(?SimpleXMLElement $simple, string $node)