private function adaptAddresses(array $addresses): array
    {
        $adapted = [];
        foreach ($addresses as $address) {
            if ($address->name() !== null) {
                $adapted[$address->email()] = $address->name();
            } else {
                $adapted[] = $address->email();
            }
        }

        return $adapted;
    }
private function adaptAddresses(array $addresses): array
    {
        $adapted = [];
        foreach ($addresses as $address) {
            if ($address->name() !== null) {
                $adapted[$address->email()] = $address->name();
            } else {
                $adapted[] = $address->email();
            }
        }

        return $adapted;
    }
private function adaptAddresses ( array $ addresses ) : array { $ adapted = [ ] ; foreach ( $ addresses as $ address ) { if ( $ address -> name ( ) !== null ) { $ adapted [ $ address -> email ( ) ] = $ address -> name ( ) ; } else { $ adapted [ ] = $ address -> email ( ) ; } } return $ adapted ; }
Adapt the given e-mail addresses to a format suitable for Swift Mailer.

@param EmailAddress[] $addresses

@return array
Adapt the given e - mail addresses to a format suitable for Swift Mailer .