Code Duplication    Length = 12-15 lines in 2 locations

src/Message.php 2 locations

@@ 398-409 (lines=12) @@
395
     * $this->contentPart.  Adds the current contentPart below the newly created
396
     * alternative part.
397
     */
398
    private function createAlternativeContentPart()
399
    {
400
        $altPart = $this->mimePartFactory->newMimePart();
401
        $contentPart = $this->contentPart;
402
        $this->setMimeHeaderBoundaryOnPart($altPart, 'multipart/alternative');
403
        $this->removePart($contentPart);
404
        $contentPart->setParent($altPart);
405
        $this->contentPart = null;
406
        $altPart->setParent($this);
407
        $this->addPart($altPart, 0);
408
        $this->addPart($contentPart, 0);
409
    }
410
    
411
    /**
412
     * Copies Content-Type, Content-Disposition and Content-Transfer-Encoding
@@ 503-517 (lines=15) @@
500
     * 
501
     * @param string $body
502
     */
503
    public function createSignaturePart($body)
504
    {
505
        $signedPart = $this->signedSignaturePart;
506
        if ($signedPart === null) {
507
            $signedPart = $this->mimePartFactory->newMimePart();
508
            $signedPart->setParent($this);
509
            $this->addPart($signedPart);
510
            $this->signedSignaturePart = $signedPart;
511
        }
512
        $signedPart->setRawHeader(
513
            'Content-Type',
514
            $this->getHeaderParameter('Content-Type', 'protocol')
515
        );
516
        $signedPart->setContent($body);
517
    }
518
519
    /**
520
     * Loops over parts of this message and sets the content-transfer-encoding