1 | <?php |
||
19 | class DefaultCellBuilder implements CellBuilderInterface |
||
20 | { |
||
21 | /** |
||
22 | * A-Z character array to build cell ids. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | private $characters = array(); |
||
27 | |||
28 | /** |
||
29 | * Array of control characters that should be escaped. |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | private $controlCharacters = array(); |
||
34 | |||
35 | /** |
||
36 | * Array of escape characters to replace control characters. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | private $escapeCharacters = array(); |
||
41 | |||
42 | /** |
||
43 | * CellBuilder constructor to instantiate character properties. |
||
44 | */ |
||
45 | 4 | public function __construct() |
|
56 | |||
57 | /** |
||
58 | * Build and return the string for a single cell. |
||
59 | * |
||
60 | * @param int $rowNumber |
||
61 | * @param int $cellNumber |
||
62 | * @param string $value |
||
63 | * @param int $styleId |
||
64 | * @return string |
||
65 | */ |
||
66 | 2 | public function build($rowNumber, $cellNumber, $value, $styleId = 0) |
|
84 | |||
85 | /** |
||
86 | * Turn a integer cell number + row number into a valid cell identifier |
||
87 | * like e.g. A1, Z1, AA1 etc and return it. |
||
88 | * |
||
89 | * @param int $cellNumber |
||
90 | * @param int|null $rowNumber |
||
91 | * @return string |
||
92 | */ |
||
93 | 2 | private function getCellId($cellNumber, $rowNumber = null) |
|
101 | |||
102 | /** |
||
103 | * Replace control characters with escape characters. |
||
104 | * |
||
105 | * @param string $value |
||
106 | * @return string |
||
107 | */ |
||
108 | 1 | private function escapeControlCharacters($value) |
|
112 | } |
||
113 |