Code Duplication    Length = 10-12 lines in 2 locations

lib/classes/Swift/Mime/SimpleMessage.php 2 locations

@@ 571-582 (lines=12) @@
568
     *
569
     * @return string
570
     */
571
    public function toString()
572
    {
573
        if (count($children = $this->getChildren()) > 0 && $this->getBody() != '') {
574
            $this->setChildren(array_merge(array($this->_becomeMimePart()), $children));
575
            $string = parent::toString();
576
            $this->setChildren($children);
577
        } else {
578
            $string = parent::toString();
579
        }
580
581
        return $string;
582
    }
583
584
    /**
585
     * Returns a string representation of this object.
@@ 601-610 (lines=10) @@
598
     *
599
     * @param Swift_InputByteStream $is
600
     */
601
    public function toByteStream(Swift_InputByteStream $is)
602
    {
603
        if (count($children = $this->getChildren()) > 0 && $this->getBody() != '') {
604
            $this->setChildren(array_merge(array($this->_becomeMimePart()), $children));
605
            parent::toByteStream($is);
606
            $this->setChildren($children);
607
        } else {
608
            parent::toByteStream($is);
609
        }
610
    }
611
612
    /** @see Swift_Mime_SimpleMimeEntity::_getIdField() */
613
    protected function _getIdField()