private function closeOpenGroups()
    {
        $this->data['groupPriorityStack'][] = 'main';
        while ($this->data['groupPriorityStack']) {
            $priority = \array_pop($this->data['groupPriorityStack']);
            foreach ($this->data['groupStacks'][$priority] as $i => $info) {
                if ($info['collect']) {
                    unset($this->data['groupStacks'][$priority][$i]);
                    $meta = array(
                        'channel' => $info['channel'],
                    );
                    if ($priority === 'main') {
                        $this->data['log'][] = array('groupEnd', array(), $meta);
                    } else {
                        $this->data['logSummary'][$priority][] = array('groupEnd', array(), $meta);
                    }
                }
            }
        }
    }