Code Duplication    Length = 12-15 lines in 2 locations

src/Message.php 2 locations

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