Code Duplication    Length = 16-18 lines in 2 locations

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

@@ 635-652 (lines=18) @@
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
641
                        if ($this->_bodyCanonLine === '') {
642
                            ++$this->_bodyCanonEmptyCounter;
643
                        } else {
644
                            $this->_bodyCanonLine = '';
645
                            $canon .= "\r\n";
646
                        }
647
                        
648
                    } else {
649
                        // Wooops Error
650
                        // todo handle it but should never happen
651
                    }
652
                    break;
653
                case ' ':
654
                case "\t":
655
                    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