Code Duplication    Length = 6-7 lines in 5 locations

main/inc/lib/icalcreator/iCalcreator.class.php 5 locations

@@ 639-645 (lines=7) @@
636
                $subcfg  = array( 'FORMAT' => $value );
637
                $res = TRUE;
638
                break;
639
            case 'LANGUAGE':
640
                // set language for calendar component as defined in [RFC 1766]
641
                $value   = trim( $value );
642
                $this->language = $value;
643
                $subcfg  = array( 'LANGUAGE' => $value );
644
                $res = TRUE;
645
                break;
646
            case 'NL':
647
            case 'NEWLINECHAR':
648
                $this->nl = $value;
@@ 652-657 (lines=6) @@
649
                $subcfg  = array( 'NL' => $value );
650
                $res = TRUE;
651
                break;
652
            case 'UNIQUE_ID':
653
                $value   = trim( $value );
654
                $this->unique_id = $value;
655
                $subcfg  = array( 'UNIQUE_ID' => $value );
656
                $res = TRUE;
657
                break;
658
            case 'URL':
659
                /* remote file - URL */
660
                $value     = trim( $value );
@@ 5676-5682 (lines=7) @@
5673
                $subcfg = array( 'ALLOWEMPTY' => $value );
5674
                $res    = TRUE;
5675
                break;
5676
            case 'FORMAT':
5677
                $value  = trim( $value );
5678
                $this->format = $value;
5679
                $this->_createFormat();
5680
                $subcfg = array( 'FORMAT' => $value );
5681
                $res    = TRUE;
5682
                break;
5683
            case 'LANGUAGE':
5684
                // set language for calendar component as defined in [RFC 1766]
5685
                $value  = trim( $value );
@@ 5683-5689 (lines=7) @@
5680
                $subcfg = array( 'FORMAT' => $value );
5681
                $res    = TRUE;
5682
                break;
5683
            case 'LANGUAGE':
5684
                // set language for calendar component as defined in [RFC 1766]
5685
                $value  = trim( $value );
5686
                $this->language = $value;
5687
                $subcfg = array( 'LANGUAGE' => $value );
5688
                $res    = TRUE;
5689
                break;
5690
            case 'NL':
5691
            case 'NEWLINECHAR':
5692
                $this->nl = $value;
@@ 5696-5701 (lines=6) @@
5693
                $subcfg = array( 'NL' => $value );
5694
                $res    = TRUE;
5695
                break;
5696
            case 'UNIQUE_ID':
5697
                $value  = trim( $value );
5698
                $this->unique_id = $value;
5699
                $subcfg = array( 'UNIQUE_ID' => $value );
5700
                $res    = TRUE;
5701
                break;
5702
        }
5703
        if( !$res ) return FALSE;
5704
        if( isset( $subcfg ) && !empty( $this->components )) {