src/Sentence.php
private function parenthesesMerge($parts)
    {
        $subsentences = [];

        foreach ($parts as $part) {
            if ($part[0] === ')') {
                $subsentences[count($subsentences) - 1] .= $part;
            } else {
                $subsentences[] = $part;
            }
        }

        return $subsentences;
    }
private function parenthesesMerge($parts)
    {
        $subsentences = [];

        foreach ($parts as $part) {
            if ($part[0] === ')') {
                $subsentences[count($subsentences) - 1] .= $part;
            } else {
                $subsentences[] = $part;
            }
        }

        return $subsentences;
    }
private function parenthesesMerge ( $ parts ) { $ subsentences = [ ] ; foreach ( $ parts as $ part ) { if ( $ part [ 0 ] === ')' ) { $ subsentences [ count ( $ subsentences ) - 1 ] .= $ part ; } else { $ subsentences [ ] = $ part ; } } return $ subsentences ; }
Merges any part starting with a closing parenthesis ')' to the previous
part.

@param string[] $parts
@return string[]
Merges any part starting with a closing parenthesis ) to the previous part .