public function spliceCallback(Collection $collection, $key, array $matches)
    {
        // $collection isn't used as this is an internal function.
        $start = $matches['start'];
        $end = $matches['end'];

        // You can use the END keyword to select everything up until an end point.
        if ($end == 'END') {
            $end = count($this->contents) - 1;
        }

        // If the start is negative, we count backwards from the end of the CSV. array_slice can handle negative
        // offsets, but bounds checking gets a bit gnarly.
        if ($start < 0) {
            $start = (count($this->contents)) - abs($start);
        }

        // Check the bounds:
        if ($start >= count($this->contents)) {
            throw new Exception\Bounds(
                'Start index (' . $start . ') is beyond the end of the file',
                Exception\Bounds::ERROR_START_OUT_OF_RANGE
            );
        } elseif ($start > $end) {
            throw new Exception\Bounds(
                'Start index is greater than end index: ' . $start . ' > ' . $end,
                Exception\Bounds::ERROR_START_GT_END
            );
        }

        // If the end index is > the total, we set to the total:
        if ($end >= count($this->contents)) {
            $end = count($this->contents) - 1;
        }

        // Now work out the params for array_slice
        $offset = $start;
        $length = ($end - $start) + 1;

        return array_slice($this->contents, $offset, $length);
    }