1 | <?php |
||
16 | class DefaultCellBuilder implements CellBuilderInterface, NumberCellInterface, StringCellInterface |
||
17 | { |
||
18 | /** |
||
19 | * A-Z character array to build cell ids. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | private $characters = array(); |
||
24 | |||
25 | /** |
||
26 | * Array of control characters that should be escaped. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | private $controlCharacters = array(); |
||
31 | |||
32 | /** |
||
33 | * Array of escape characters to replace control characters. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | private $escapeCharacters = array(); |
||
38 | |||
39 | /** |
||
40 | * CellBuilder constructor to instantiate character properties. |
||
41 | */ |
||
42 | 4 | public function __construct() |
|
53 | |||
54 | /** |
||
55 | * Build and return the string for a single cell. |
||
56 | * |
||
57 | * @param int $rowNumber |
||
58 | * @param int $cellNumber |
||
59 | * @param string $value |
||
60 | * @param int $styleId |
||
61 | * @return string |
||
62 | */ |
||
63 | 2 | public function build($rowNumber, $cellNumber, $value, $styleId = 0) |
|
77 | |||
78 | /** |
||
79 | * Turn a integer cell number + row number into a valid cell identifier |
||
80 | * like e.g. A1, Z1, AA1 etc and return it. |
||
81 | * |
||
82 | * @param int $cellNumber |
||
83 | * @param int|null $rowNumber |
||
84 | * @return string |
||
85 | */ |
||
86 | 2 | private function getCellId($cellNumber, $rowNumber = null) |
|
94 | |||
95 | /** |
||
96 | * Replace control characters with escape characters. |
||
97 | * |
||
98 | * @param string $value |
||
99 | * @return string |
||
100 | */ |
||
101 | 1 | private function escapeControlCharacters($value) |
|
105 | } |