private function collectBranch(array $start, array $end, array $locations, array $coverage = []) : void
    {
        $this->fileCoverage['branchMap'][] = [
            'type' => 'switch',
            'locations' => $locations,
            'loc' => ['start' => $start, 'end' => $end],
        ];

        $this->fileCoverage['b'][] = $coverage;

        // Collect statements as well (entire branch is a statement, each location is a statement)
        $this->collectStatement($start, $end, (int) array_sum($coverage));

        for ($i = 0, $count = count($locations); $i < $count; ++$i) {
            $this->collectStatement($locations[$i]['start'], $locations[$i]['end'], $coverage[$i]);
        }
    }