Code Duplication    Length = 5-5 lines in 2 locations

code/MailgunSwiftTransport.php 2 locations

@@ 316-320 (lines=5) @@
313
        // Mandrill compatibility
314
        // Data is merge with transmission and removed from headers
315
        // @link https://mandrill.zendesk.com/hc/en-us/articles/205582467-How-to-Use-Tags-in-Mandrill
316
        if ($message->getHeaders()->has('X-MC-Tags')) {
317
            $tagsHeader = $message->getHeaders()->get('X-MC-Tags');
318
            $tags = explode(',', $tagsHeader->getValue());
319
            $message->getHeaders()->remove('X-MC-Tags');
320
        }
321
        if ($message->getHeaders()->has('X-MC-Metadata')) {
322
            $metadataHeader = $message->getHeaders()->get('X-MC-Metadata');
323
            $metadata = json_decode($metadataHeader->getValue(), JSON_OBJECT_AS_ARRAY);
@@ 334-338 (lines=5) @@
331
        // Handle mailgun headers
332
        // Data is merge with message and removed from headers
333
        // @link https://documentation.mailgun.com/en/latest/user_manual.html#sending-via-smtp
334
        if ($message->getHeaders()->has('X-Mailgun-Tag')) {
335
            $tagsHeader = $message->getHeaders()->get('X-Mailgun-Tag');
336
            $tags = explode(',', $tagsHeader->getValue());
337
            $message->getHeaders()->remove('X-Mailgun-Tag');
338
        }
339
        // @link https://documentation.mailgun.com/en/latest/user_manual.html#attaching-data-to-messages
340
        if ($message->getHeaders()->has('X-Mailgun-Variables')) {
341
            $metadataHeader = $message->getHeaders()->get('X-Mailgun-Variables');