Code Duplication    Length = 28-28 lines in 2 locations

install/instprocessor.php 1 location

@@ 127-154 (lines=28) @@
124
    }
125
}
126
127
if(!function_exists('parseProperties')) {
128
    /**
129
     * parses a resource property string and returns the result as an array
130
     * duplicate of method in documentParser class
131
     *
132
     * @param string $propertyString
133
     * @return array
134
     */
135
    function parseProperties($propertyString) {
136
        $parameter= array ();
137
        if (!empty ($propertyString)) {
138
            $tmpParams= explode("&", $propertyString);
139
            $countParams = count($tmpParams);
140
            for ($x= 0; $x < $countParams; $x++) {
141
                if (strpos($tmpParams[$x], '=', 0)) {
142
                    $pTmp= explode("=", $tmpParams[$x]);
143
                    $pvTmp= explode(";", trim($pTmp[1]));
144
                    if ($pvTmp[1] == 'list' && $pvTmp[3] != "")
145
                        $parameter[trim($pTmp[0])]= $pvTmp[3]; //list default
146
                    else
147
                        if ($pvTmp[1] != 'list' && $pvTmp[2] != "")
148
                            $parameter[trim($pTmp[0])]= $pvTmp[2];
149
                }
150
            }
151
        }
152
        return $parameter;
153
    }
154
}
155
156
// check status of Inherit Parent Template plugin
157
$auto_template_logic = 'parent';

install/cli-install.php 1 location

@@ 506-533 (lines=28) @@
503
    }
504
}
505
506
if(!function_exists('parseProperties')) {
507
    /**
508
     * parses a resource property string and returns the result as an array
509
     * duplicate of method in documentParser class
510
     *
511
     * @param string $propertyString
512
     * @return array
513
     */
514
    function parseProperties($propertyString) {
515
        $parameter= array ();
516
        if (!empty ($propertyString)) {
517
            $tmpParams= explode("&", $propertyString);
518
            $countParams = count($tmpParams);
519
            for ($x= 0; $x < $countParams; $x++) {
520
                if (strpos($tmpParams[$x], '=', 0)) {
521
                    $pTmp= explode("=", $tmpParams[$x]);
522
                    $pvTmp= explode(";", trim($pTmp[1]));
523
                    if ($pvTmp[1] == 'list' && $pvTmp[3] != "")
524
                        $parameter[trim($pTmp[0])]= $pvTmp[3]; //list default
525
                    else
526
                        if ($pvTmp[1] != 'list' && $pvTmp[2] != "")
527
                            $parameter[trim($pTmp[0])]= $pvTmp[2];
528
                }
529
            }
530
        }
531
        return $parameter;
532
    }
533
}
534
535
// check status of Inherit Parent Template plugin
536
$auto_template_logic = 'parent';