Code Duplication    Length = 19-19 lines in 2 locations

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

@@ 1092-1110 (lines=19) @@
1089
            $index = ( ctype_digit( (string) $arg2 )) ? ((int) $arg2) - 1 : 0;
1090
        }
1091
        $cix1sC = 0;
1092
        foreach ( $this->components as $cix => $component2) {
1093
            if( empty( $component2 )) continue;
1094
            unset( $component2->propix );
1095
            if(( 'INDEX' == $argType ) && ( $index == $cix )) {
1096
                $this->components[$cix] = $component->copy();
1097
                return TRUE;
1098
            }
1099
            elseif( $argType == $component2->objName ) {
1100
                if( $index == $cix1sC ) {
1101
                    $this->components[$cix] = $component->copy();
1102
                    return TRUE;
1103
                }
1104
                $cix1sC++;
1105
            }
1106
            elseif( !$argType && ( $arg1 == $component2->getProperty( 'uid' ))) {
1107
                $this->components[$cix] = $component->copy();
1108
                return TRUE;
1109
            }
1110
        }
1111
        /* not found.. . insert last in chain anyway .. .*/
1112
        $this->components[] = $component->copy();
1113
        return TRUE;
@@ 6753-6771 (lines=19) @@
6750
            $index = ( ctype_digit( (string) $arg2 )) ? ((int) $arg2) - 1 : 0;
6751
        }
6752
        $cix2sC = 0;
6753
        foreach ( $this->components as $cix => $component2 ) {
6754
            if( empty( $component2 )) continue;
6755
            unset( $component2->propix );
6756
            if(( 'INDEX' == $argType ) && ( $index == $cix )) {
6757
                $this->components[$cix] = $component->copy();
6758
                return TRUE;
6759
            }
6760
            elseif( $argType == $component2->objName ) {
6761
                if( $index == $cix2sC ) {
6762
                    $this->components[$cix] = $component->copy();
6763
                    return TRUE;
6764
                }
6765
                $cix2sC++;
6766
            }
6767
            elseif( !$argType && ($arg1 == $component2->getProperty( 'uid' ))) {
6768
                $this->components[$cix] = $component->copy();
6769
                return TRUE;
6770
            }
6771
        }
6772
        /* not found.. . insert anyway.. .*/
6773
        $this->components[] = $component->copy();
6774
        return TRUE;