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

Method removeNullColumns

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

Source from the content-addressed store, hash-verified

234 }
235
236 private function removeNullColumns(array $data): array {
237 // Transpose the data to work with columns as rows
238 $transposedData = array_map(null, ...$data);
239
240 // Filter out columns that contain only null values
241 $filteredData = array_filter($transposedData, function ($column) {
242 return !$this->containsOnlyNull($column);
243 });
244
245 // Transpose back to original row-column structure
246 return array_map(null, ...$filteredData);
247 }
248
249 /**
250 * @param $array

Callers 1

readDataMethod · 0.95

Calls 1

containsOnlyNullMethod · 0.95

Tested by

no test coverage detected