protected function mergeDuplicates(array $line)
    {
        $values = [];

        $i = 0;
        foreach ($this->columnHeaders as $count) {
            if (1 === $count) {
                $values[] = $line[$i];
            } else {
                $values[] = array_slice($line, $i, $count);
            }

            $i += $count;
        }

        return $values;
    }
protected function mergeDuplicates(array $line)
    {
        $values = [];

        $i = 0;
        foreach ($this->columnHeaders as $count) {
            if (1 === $count) {
                $values[] = $line[$i];
            } else {
                $values[] = array_slice($line, $i, $count);
            }

            $i += $count;
        }

        return $values;
    }
protected function mergeDuplicates ( array $ line ) { $ values = [ ] ; $ i = 0 ; foreach ( $ this -> columnHeaders as $ count ) { if ( 1 === $ count ) { $ values [ ] = $ line [ $ i ] ; } else { $ values [ ] = array_slice ( $ line , $ i , $ count ) ; } $ i += $ count ; } return $ values ; }
Merges values for duplicate headers into an array

So the following line:
|duplicate|duplicate|duplicate|
|first    |second   |third    |

Yields value:
$duplicate => ['first', 'second', 'third']

@param array $line

@return array
Merges values for duplicate headers into an array