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

Method removeNullColumns

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

Source from the content-addressed store, hash-verified

207 }
208
209 private function removeNullColumns(array $data): array {
210 // Transpose the data to work with columns as rows
211 $transposedData = array_map(null, ...$data);
212
213 // Filter out columns that contain only null values
214 $filteredData = array_filter($transposedData, function ($column) {
215 return !$this->containsOnlyNull($column);
216 });
217
218 // Transpose back to original row-column structure
219 return array_map(null, ...$filteredData);
220 }
221
222 /**
223 * @param $array

Callers 1

readDataMethod · 0.95

Calls 1

containsOnlyNullMethod · 0.95

Tested by

no test coverage detected