1 | <?php |
||
14 | class CellBuilder |
||
15 | { |
||
16 | /** |
||
17 | * Array of control characters that should be escaped. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | private $controlCharacters = array(); |
||
22 | |||
23 | /** |
||
24 | * Array of escape characters to replace control characters. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | private $escapeCharacters = array(); |
||
29 | |||
30 | /** |
||
31 | * Regex pattern containing control characters. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | private $escapeCharacterPattern; |
||
36 | |||
37 | /** |
||
38 | * CellBuilder constructor to create escaping arrays. |
||
39 | */ |
||
40 | 16 | public function __construct() |
|
51 | |||
52 | /** |
||
53 | * Build and return the string for a single cell. |
||
54 | * |
||
55 | * @param int $rowNumber |
||
56 | * @param int $cellNumber |
||
57 | * @param mixed $cellValue |
||
58 | * @param int $styleId |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | 5 | public function build($rowNumber, $cellNumber, $cellValue, $styleId = 0) |
|
74 | |||
75 | /** |
||
76 | * Turn a integer cell number + row number into a valid cell identifier |
||
77 | * like e.g. A1, Z1, AA1 etc and return it. |
||
78 | * |
||
79 | * @param int $cellNumber |
||
80 | * @param int|null $rowNumber |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | 6 | public function getCellId($cellNumber, $rowNumber = null) |
|
92 | |||
93 | /** |
||
94 | * Escape/replace control characters. |
||
95 | * |
||
96 | * @param string $value |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | 3 | private function escape($value) |
|
110 | } |
||
111 | |||
112 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.