1 | <?php |
||
15 | class CellHelper |
||
16 | { |
||
17 | /** |
||
18 | * Fixed character array to build cell ids, because chr(65+n) |
||
19 | * eats to much performance. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | private static $chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); |
||
24 | |||
25 | /** |
||
26 | * Control character map for escaping. |
||
27 | * |
||
28 | * @var array(array()) |
||
29 | */ |
||
30 | private static $ctrls = array(); |
||
31 | |||
32 | /** |
||
33 | * Build and return the string for a single cell. |
||
34 | * |
||
35 | * @param int $rowId |
||
36 | * @param int $cellNo |
||
37 | * @param string $value |
||
38 | * @param int|null $styleId |
||
39 | * @return string |
||
40 | * @throws \InvalidArgumentException |
||
41 | */ |
||
42 | 3 | public static function buildCell($rowId, $cellNo, $value, $styleId = 0) |
|
57 | |||
58 | /** |
||
59 | * Turn a integer cell number + row number into a valid cell identifier |
||
60 | * like e.g. A1, Z1, AA1 etc and return it. |
||
61 | * |
||
62 | * @param int $cellNo |
||
63 | * @param int|null $rowIndex |
||
64 | * @return string |
||
65 | */ |
||
66 | 3 | private static function buildId($cellNo, $rowIndex = null) |
|
74 | |||
75 | /** |
||
76 | * Set mapping for control character escaping. |
||
77 | * |
||
78 | * @param array $map |
||
79 | */ |
||
80 | 3 | public static function setCtrlCharacterMap(array $map) |
|
84 | } |
||
85 |