Code Duplication    Length = 8-8 lines in 2 locations

transports/mail/drivers/Sendgrid.php 2 locations

@@ 160-167 (lines=8) @@
157
     */
158
    protected function processFirstAddress(array $addresses) : array
159
    {
160
        foreach ($addresses as $email => $name) {
161
            return $name ? [
162
                'email' => $email,
163
                'name'  => $name
164
            ] : [
165
                'email' => $email
166
            ];
167
        }
168
169
        return [];
170
    }
@@ 182-189 (lines=8) @@
179
    {
180
        $result = [];
181
182
        foreach ($addresses as $email => $name) {
183
            $result[] = $name ? [
184
                'email' => $email,
185
                'name'  => $name
186
            ] : [
187
                'email' => $email
188
            ];
189
        }
190
191
        return $result;
192
    }