| @@ -49,10 +49,16 @@ | ||
| 49 | 49 | private Spreadsheet $spreadsheet; |
| 50 | 50 | |
| 51 | 51 | private ReferenceHelper $referenceHelper; |
| 52 | 52 | |
| 53 | - /** @var array{'dataType': string[]} */ | |
| 54 | - public static array $mappings = [ | |
| 53 | + /** | |
| 54 | + * @deprecated 5.10.0 No longer used, replaced by const which is not user-accessible. | |
| 55 | + * | |
| 56 | + * @var array{'dataType': string[]} | |
| 57 | + */ | |
| 58 | + public static array $mappings = self::MAPPINGS; | |
| 59 | + | |
| 60 | + private const MAPPINGS = [ | |
| 55 | 61 | 'dataType' => [ |
| 56 | 62 | '10' => DataType::TYPE_NULL, |
| 57 | 63 | '20' => DataType::TYPE_BOOL, |
| 58 | 64 | '30' => DataType::TYPE_NUMERIC, // Integer doesn't exist in Excel |
| @@ -229,12 +235,16 @@ | ||
| 229 | 235 | |
| 230 | 236 | return $data; |
| 231 | 237 | } |
| 232 | 238 | |
| 233 | - /** @return mixed[] */ | |
| 239 | + /** | |
| 240 | + * @return mixed[] | |
| 241 | + * | |
| 242 | + * @internal | |
| 243 | + */ | |
| 234 | 244 | public static function gnumericMappings(): array |
| 235 | 245 | { |
| 236 | - return array_merge(self::$mappings, Styles::$mappings); | |
| 246 | + return array_merge(self::MAPPINGS, Styles::MAPPINGS); | |
| 237 | 247 | } |
| 238 | 248 | |
| 239 | 249 | private function processComments(SimpleXMLElement $sheet): void |
| 240 | 250 | { |
| @@ -284,10 +294,9 @@ | ||
| 284 | 294 | } |
| 285 | 295 | |
| 286 | 296 | $gFileData = $this->gzfileGetContents($filename); |
| 287 | 297 | |
| 288 | - /** @var XmlScanner */ | |
| 289 | - $securityScanner = $this->securityScanner; | |
| 298 | + $securityScanner = $this->getSecurityScannerOrThrow(); | |
| 290 | 299 | $xml2 = simplexml_load_string($securityScanner->scan($gFileData)); |
| 291 | 300 | $xml = self::testSimpleXml($xml2); |
| 292 | 301 | |
| 293 | 302 | $gnmXML = $xml->children(self::NAMESPACE_GNM); |
| @@ -613,10 +622,10 @@ | ||
| 613 | 622 | } |
| 614 | 623 | $type = DataType::TYPE_FORMULA; |
| 615 | 624 | } elseif ($isArrayFormula === false) { |
| 616 | 625 | $vtype = (string) $ValueType; |
| 617 | - if (array_key_exists($vtype, self::$mappings['dataType'])) { | |
| 618 | - $type = self::$mappings['dataType'][$vtype]; | |
| 626 | + if (array_key_exists($vtype, self::MAPPINGS['dataType'])) { | |
| 627 | + $type = self::MAPPINGS['dataType'][$vtype]; | |
| 619 | 628 | } |
| 620 | 629 | if ($vtype === '20') { // Boolean |
| 621 | 630 | $cell = $cell == 'TRUE'; |
| 622 | 631 | } |