Code Duplication    Length = 16-18 lines in 2 locations

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

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

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

@@ 684-701 (lines=18) @@
681
                case "\r":
682
                    $this->_bodyCanonLastChar = "\r";
683
                    break;
684
                case "\n":
685
                    if ($this->_bodyCanonLastChar === "\r") {
686
                        if ($method) {
687
                            $this->_bodyCanonSpace = false;
688
                        }
689
690
                        if ($this->_bodyCanonLine === '') {
691
                            ++$this->_bodyCanonEmptyCounter;
692
                        } else {
693
                            $this->_bodyCanonLine = '';
694
                            $canon .= "\r\n";
695
                        }
696
697
                    } else {
698
                        // Wooops Error
699
                        // TODO: handle it but should never happen
700
                    }
701
                    break;
702
                case ' ':
703
                case "\t":
704
                    if ($method) {