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]);
        }
    }
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]);
        }
    }
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 ] ) ; } }
Collects and stores a branch's location information as well as any coverage counts

@param array $start
@param array $end
@param array $locations
@param int[] $coverage
Collects and stores a branch s location information as well as any coverage counts