public function map(array $parts): array
    {
        $max = ($this->maxIndex > 0) ? $this->maxIndex : floor(count($parts) / 2);

        for ($k = 0; $k < $max; $k++) {
            $part = $parts[$k];

            if ($part instanceof AbstractPart) {
                break;
            }

            if ($this->isSalutation($part)) {
                $parts[$k] = new Salutation($part, $this->salutations[$this->getKey($part)]);
            }
        }

        return $parts;
    }
public function map(array $parts): array
    {
        $max = ($this->maxIndex > 0) ? $this->maxIndex : floor(count($parts) / 2);

        for ($k = 0; $k < $max; $k++) {
            $part = $parts[$k];

            if ($part instanceof AbstractPart) {
                break;
            }

            if ($this->isSalutation($part)) {
                $parts[$k] = new Salutation($part, $this->salutations[$this->getKey($part)]);
            }
        }

        return $parts;
    }
public function map ( array $ parts ) : array { $ max = ( $ this -> maxIndex > 0 ) ? $ this -> maxIndex : floor ( count ( $ parts ) / 2 ) ; for ( $ k = 0 ; $ k < $ max ; $ k ++ ) { $ part = $ parts [ $ k ] ; if ( $ part instanceof AbstractPart ) { break ; } if ( $ this -> isSalutation ( $ part ) ) { $ parts [ $ k ] = new Salutation ( $ part , $ this -> salutations [ $ this -> getKey ( $ part ) ] ) ; } } return $ parts ; }
map salutations in the parts array

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