Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 440-454 (lines=15) @@
437
    /**
438
     * @param string $header
439
     */
440
    protected function _addHeader($header)
441
    {
442
        switch ($this->_canon) {
443
            case 'nofws':
444
                // Prepare Header and cascade
445
                $exploded = explode(':', $header, 2);
446
                $name = Swift::strtolowerWithStaticCache(trim($exploded[0]));
447
                $value = str_replace("\r\n", '', $exploded[1]);
448
                $value = preg_replace("/[ \t][ \t]+/", ' ', $value);
449
                $header = $name . ':' . trim($value) . "\r\n";
450
            case 'simple':
451
                // Nothing to do
452
        }
453
        $this->_addToHash($header);
454
    }
455
456
    protected function _endOfHeaders()
457
    {

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

@@ 642-656 (lines=15) @@
639
     * @param string $header
640
     * @param bool   $is_sig
641
     */
642
    protected function _addHeader($header, $is_sig = false)
643
    {
644
        switch ($this->_headerCanon) {
645
            case 'relaxed':
646
                // Prepare Header and cascade
647
                $exploded = explode(':', $header, 2);
648
                $name = Swift::strtolowerWithStaticCache(trim($exploded[0]));
649
                $value = str_replace("\r\n", '', $exploded[1]);
650
                $value = preg_replace("/[ \t][ \t]+/", ' ', $value);
651
                $header = $name . ':' . trim($value) . ($is_sig ? '' : "\r\n");
652
            case 'simple':
653
                // Nothing to do
654
        }
655
        $this->_addToHeaderHash($header);
656
    }
657
658
    /**
659
     * @deprecated This method is currently useless in this class but it must be