@@ 157-174 (lines=18) @@ | ||
154 | * |
|
155 | * @return int The number of columns in cellAddress |
|
156 | */ |
|
157 | public static function COLUMNS($cellAddress = null) |
|
158 | { |
|
159 | if (is_null($cellAddress) || $cellAddress === '') { |
|
160 | return 1; |
|
161 | } elseif (!is_array($cellAddress)) { |
|
162 | return Functions::VALUE(); |
|
163 | } |
|
164 | ||
165 | reset($cellAddress); |
|
166 | $isMatrix = (is_numeric(key($cellAddress))); |
|
167 | list($columns, $rows) = \PhpOffice\PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress); |
|
168 | ||
169 | if ($isMatrix) { |
|
170 | return $rows; |
|
171 | } |
|
172 | ||
173 | return $columns; |
|
174 | } |
|
175 | ||
176 | /** |
|
177 | * ROW. |
|
@@ 238-255 (lines=18) @@ | ||
235 | * |
|
236 | * @return int The number of rows in cellAddress |
|
237 | */ |
|
238 | public static function ROWS($cellAddress = null) |
|
239 | { |
|
240 | if (is_null($cellAddress) || $cellAddress === '') { |
|
241 | return 1; |
|
242 | } elseif (!is_array($cellAddress)) { |
|
243 | return Functions::VALUE(); |
|
244 | } |
|
245 | ||
246 | reset($cellAddress); |
|
247 | $isMatrix = (is_numeric(key($cellAddress))); |
|
248 | list($columns, $rows) = \PhpOffice\PhpSpreadsheet\Calculation::_getMatrixDimensions($cellAddress); |
|
249 | ||
250 | if ($isMatrix) { |
|
251 | return $columns; |
|
252 | } |
|
253 | ||
254 | return $rows; |
|
255 | } |
|
256 | ||
257 | /** |
|
258 | * HYPERLINK. |