public function map(array $parts): array
    {
        if ($this->isMatchingSinglePart($parts)) {
            $parts[0] = new Suffix($parts[0], $this->suffixes[$this->getKey($parts[0])]);
            return $parts;
        }

        $start = count($parts) - 1;

        for ($k = $start; $k > 1; $k--) {
            $part = $parts[$k];

            if (!$this->isSuffix($part)) {
                break;
            }

            $parts[$k] = new Suffix($part, $this->suffixes[$this->getKey($part)]);
        }

        return $parts;
    }
public function map(array $parts): array
    {
        if ($this->isMatchingSinglePart($parts)) {
            $parts[0] = new Suffix($parts[0], $this->suffixes[$this->getKey($parts[0])]);
            return $parts;
        }

        $start = count($parts) - 1;

        for ($k = $start; $k > 1; $k--) {
            $part = $parts[$k];

            if (!$this->isSuffix($part)) {
                break;
            }

            $parts[$k] = new Suffix($part, $this->suffixes[$this->getKey($part)]);
        }

        return $parts;
    }
public function map ( array $ parts ) : array { if ( $ this -> isMatchingSinglePart ( $ parts ) ) { $ parts [ 0 ] = new Suffix ( $ parts [ 0 ] , $ this -> suffixes [ $ this -> getKey ( $ parts [ 0 ] ) ] ) ; return $ parts ; } $ start = count ( $ parts ) - 1 ; for ( $ k = $ start ; $ k > 1 ; $ k -- ) { $ part = $ parts [ $ k ] ; if ( ! $ this -> isSuffix ( $ part ) ) { break ; } $ parts [ $ k ] = new Suffix ( $ part , $ this -> suffixes [ $ this -> getKey ( $ part ) ] ) ; } return $ parts ; }
map suffixes in the parts array

@param array $parts the name parts
@return array the mapped parts
map suffixes in the parts array