MCPcopy Create free account
hub / github.com/Rello/analytics / removeNullColumns

Method removeNullColumns

lib/Datasource/LocalSpreadsheet.php:219–230  ·  view source on GitHub ↗
(array $data)

Source from the content-addressed store, hash-verified

217 }
218
219 private function removeNullColumns(array $data): array {
220 // Transpose the data to work with columns as rows
221 $transposedData = array_map(null, ...$data);
222
223 // Filter out columns that contain only null values
224 $filteredData = array_filter($transposedData, function ($column) {
225 return !$this->containsOnlyNull($column);
226 });
227
228 // Transpose back to original row-column structure
229 return array_map(null, ...$filteredData);
230 }
231
232 /**
233 * @param $array

Callers 1

readDataMethod · 0.95

Calls 1

containsOnlyNullMethod · 0.95

Tested by

no test coverage detected