| 1 |
<?php |
| 2 |
|
| 3 |
namespace TablePress\PhpOffice\PhpSpreadsheet\Reader\Xml\Style; |
| 4 |
|
| 5 |
use SimpleXMLElement; |
| 6 |
|
| 7 |
abstract class StyleBase |
| 8 |
{ |
| 9 |
/** @param string[] $styleList */ |
| 10 |
protected static function identifyFixedStyleValue(array $styleList, string &$styleAttributeValue): bool |
| 11 |
{ |
| 12 |
$returnValue = false; |
| 13 |
|
| 14 |
$styleAttributeValue = strtolower($styleAttributeValue); |
| 15 |
foreach ($styleList as $style) { |
| 16 |
if ($styleAttributeValue == strtolower($style)) { |
| 17 |
$styleAttributeValue = $style; |
| 18 |
$returnValue = true; |
| 19 |
|
| 20 |
break; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
return $returnValue; |
| 25 |
} |
| 26 |
|
| 27 |
protected static function getAttributes(?SimpleXMLElement $simple, string $node): SimpleXMLElement |
| 28 |
{ |
| 29 |
return ($simple === null) ? new SimpleXMLElement('<xml></xml>') : ($simple->attributes($node) ?? new SimpleXMLElement('<xml></xml>')); |
| 30 |
} |
| 31 |
} |
| 32 |
|