public function map(array $parts): array
    {
        if (count($parts) < 2) {
            return [$this->handleSinglePart($parts[0])];
        }

        $pos = $this->findFirstnamePosition($parts);

        if (null !== $pos) {
            $parts[$pos] = new Firstname($parts[$pos]);
        }

        return $parts;
    }
public function map(array $parts): array
    {
        if (count($parts) < 2) {
            return [$this->handleSinglePart($parts[0])];
        }

        $pos = $this->findFirstnamePosition($parts);

        if (null !== $pos) {
            $parts[$pos] = new Firstname($parts[$pos]);
        }

        return $parts;
    }
public function map ( array $ parts ) : array { if ( count ( $ parts ) < 2 ) { return [ $ this -> handleSinglePart ( $ parts [ 0 ] ) ] ; } $ pos = $ this -> findFirstnamePosition ( $ parts ) ; if ( null !== $ pos ) { $ parts [ $ pos ] = new Firstname ( $ parts [ $ pos ] ) ; } return $ parts ; }
map firstnames in parts array

@param array $parts the parts
@return array the mapped parts
map firstnames in parts array