PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Reader / Xml / Style / NumberFormat.php

NumberFormat.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Reader/Xml/Style/NumberFormat.php

35 lines 732 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Reader\Xml\Style;
4
5 use SimpleXMLElement;
6
7 class NumberFormat extends StyleBase
8 {
9 /** @return mixed[] */
10 public function parseStyle(SimpleXMLElement $styleAttributes): array
11 {
12 $style = [];
13
14 $fromFormats = ['\-', '\ '];
15 $toFormats = ['-', ' '];
16
17 foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
18 $styleAttributeValue = str_replace($fromFormats, $toFormats, (string) $styleAttributeValue);
19
20 switch ($styleAttributeValue) {
21 case 'Short Date':
22 $styleAttributeValue = 'dd/mm/yyyy';
23
24 break;
25 }
26
27 if ($styleAttributeValue > '') {
28 $style['numberFormat']['formatCode'] = $styleAttributeValue;
29 }
30 }
31
32 return $style;
33 }
34 }
35