Code Duplication    Length = 16-16 lines in 2 locations

lib/classes/Swift/Signers/DKIMSigner.php 1 location

@@ 635-650 (lines=16) @@
632
                case "\r" :
633
                    $this->_bodyCanonLastChar = "\r";
634
                    break;
635
                case "\n" :
636
                    if ($this->_bodyCanonLastChar == "\r") {
637
                        if ($method) {
638
                            $this->_bodyCanonSpace = false;
639
                        }
640
                        if ($this->_bodyCanonLine == '') {
641
                            ++$this->_bodyCanonEmptyCounter;
642
                        } else {
643
                            $this->_bodyCanonLine = '';
644
                            $canon .= "\r\n";
645
                        }
646
                    } else {
647
                        // Wooops Error
648
                        // todo handle it but should never happen
649
                    }
650
                    break;
651
                case ' ' :
652
                case "\t" :
653
                    if ($method) {

lib/classes/Swift/Signers/DomainKeySigner.php 1 location

@@ 476-491 (lines=16) @@
473
                case "\r" :
474
                    $this->_bodyCanonLastChar = "\r";
475
                    break;
476
                case "\n" :
477
                    if ($this->_bodyCanonLastChar == "\r") {
478
                        if ($nofws) {
479
                            $this->_bodyCanonSpace = false;
480
                        }
481
                        if ($this->_bodyCanonLine == '') {
482
                            ++$this->_bodyCanonEmptyCounter;
483
                        } else {
484
                            $this->_bodyCanonLine = '';
485
                            $canon .= "\r\n";
486
                        }
487
                    } else {
488
                        // Wooops Error
489
                        throw new Swift_SwiftException('Invalid new line sequence in mail found \n without preceding \r');
490
                    }
491
                    break;
492
                case ' ' :
493
                case "\t" :
494
                case "\x09": //HTAB