protected function convertEmailsArray(array $emails): array
    {
        $convertedEmails = [];

        foreach ($emails as $email => $name) {
            $convertedEmails[] = $name ?
            '"' . \str_replace('"', '\\"', $name) . "\" <{$email}>" :
            $email;
        }

        return $convertedEmails;
    }
protected function convertEmailsArray(array $emails): array
    {
        $convertedEmails = [];

        foreach ($emails as $email => $name) {
            $convertedEmails[] = $name ?
            '"' . \str_replace('"', '\\"', $name) . "\" <{$email}>" :
            $email;
        }

        return $convertedEmails;
    }
protected function convertEmailsArray ( array $ emails ) : array { $ convertedEmails = [ ] ; foreach ( $ emails as $ email => $ name ) { $ convertedEmails [ ] = $ name ? '"' . \ str_replace ( '"' , '\\"' , $ name ) . "\" <{$email}>" : $ email ; } return $ convertedEmails ; }
Convert email dictionary with emails and names
to array of emails with names.

@param string[] $emails

@return array
Convert email dictionary with emails and names to array of emails with names .