Code Duplication    Length = 12-15 lines in 2 locations

src/Message.php 2 locations

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