Code Duplication    Length = 16-18 lines in 2 locations

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

@@ 642-659 (lines=18) @@
639
                case "\r":
640
                    $this->_bodyCanonLastChar = "\r";
641
                    break;
642
                case "\n":
643
                    if ($this->_bodyCanonLastChar === "\r") {
644
                        if ($method) {
645
                            $this->_bodyCanonSpace = false;
646
                        }
647
648
                        if ($this->_bodyCanonLine === '') {
649
                            ++$this->_bodyCanonEmptyCounter;
650
                        } else {
651
                            $this->_bodyCanonLine = '';
652
                            $canon .= "\r\n";
653
                        }
654
                        
655
                    } else {
656
                        // Wooops Error
657
                        // todo handle it but should never happen
658
                    }
659
                    break;
660
                case ' ':
661
                case "\t":
662
                    if ($method) {

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

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