Code Duplication    Length = 21-21 lines in 2 locations

install/setup.info.php 1 location

@@ 100-120 (lines=21) @@
97
98
// setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties
99
$ms = &$moduleSnippets;
100
if(is_dir($snippetPath) && is_readable($snippetPath)) {
101
    $d = dir($snippetPath);
102
    while (false !== ($tplfile = $d->read())) {
103
        if(substr($tplfile, -4) != '.tpl') {
104
            continue;
105
        }
106
        $params = parse_docblock($snippetPath, $tplfile);
107
        if(is_array($params) && count($params) > 0) {
108
            $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
109
            $ms[] = array(
110
                $params['name'],
111
                $description,
112
                "$snippetPath/{$params['filename']}",
113
                $params['properties'],
114
                $params['modx_category'],
115
                array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false
116
            );
117
        }
118
    }
119
    $d->close();
120
}
121
122
// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties
123
$mp = &$modulePlugins;

install/cli-install.php 1 location

@@ 653-673 (lines=21) @@
650
651
// setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties
652
$ms = &$moduleSnippets;
653
if(is_dir($snippetPath) && is_readable($snippetPath)) {
654
    $d = dir($snippetPath);
655
    while (false !== ($tplfile = $d->read())) {
656
        if(substr($tplfile, -4) != '.tpl') {
657
            continue;
658
        }
659
        $params = parse_docblock($snippetPath, $tplfile);
660
        if(is_array($params) && count($params) > 0) {
661
            $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
662
            $ms[] = array(
663
                $params['name'],
664
                $description,
665
                "$snippetPath/{$params['filename']}",
666
                $params['properties'],
667
                $params['modx_category'],
668
                array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false
669
            );
670
        }
671
    }
672
    $d->close();
673
}
674
675
// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties
676
$mp = &$modulePlugins;