PhpBench\Report\Generator\TableGenerator::processCols PHP Méthode

processCols() private méthode

Remove unwanted columns from the tables.
private processCols ( array $tables, Config $config ) : array
$tables array
$config PhpBench\Registry\Config
Résultat array
    private function processCols(array $tables, Config $config)
    {
        if ($config['cols']) {
            $cols = $config['cols'];
            if ($config['compare']) {
                $cols[] = $config['compare'];
                $cols = array_merge($cols, $config['compare_fields']);
            }
            $tables = F\map($tables, function ($table) use($cols) {
                return F\map($table, function ($row) use($cols) {
                    $newRow = $row->newInstance([]);
                    foreach ($cols as $col) {
                        if ($col === 'diff') {
                            continue;
                        }
                        $newRow[$col] = $row[$col];
                    }
                    return $newRow;
                });
            });
        }
        return $tables;
    }