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

processBreak() private méthode

Process breaks (split large table into smaller tables).
private processBreak ( array $table, Config $config ) : array
$table array
$config PhpBench\Registry\Config
Résultat array
    private function processBreak(array $table, Config $config)
    {
        if (!$config['break']) {
            return [$table];
        }
        $break = $config['break'];
        foreach ($break as $breakKey) {
            // remove the break col from the visible cols.
            if (false !== ($index = array_search($breakKey, $config['cols']))) {
                $cols = $config['cols'];
                unset($cols[$index]);
                $config['cols'] = $cols;
            }
        }
        return F\group($table, function ($row) use($break) {
            $breakHash = [];
            foreach ($break as $breakKey) {
                $breakHash[] = $breakKey . ': ' . $row[$breakKey];
                unset($row[$breakKey]);
            }
            return implode(', ', $breakHash);
        });
    }