Code Duplication    Length = 21-21 lines in 2 locations

install/cli-install.php 1 location

@@ 637-657 (lines=21) @@
634
635
// setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties
636
$ms = &$moduleSnippets;
637
if(is_dir($snippetPath) && is_readable($snippetPath)) {
638
    $d = dir($snippetPath);
639
    while (false !== ($tplfile = $d->read())) {
640
        if(substr($tplfile, -4) != '.tpl') {
641
            continue;
642
        }
643
        $params = parse_docblock($snippetPath, $tplfile);
644
        if(is_array($params) && count($params) > 0) {
645
            $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
646
            $ms[] = array(
647
                $params['name'],
648
                $description,
649
                "$snippetPath/{$params['filename']}",
650
                $params['properties'],
651
                $params['modx_category'],
652
                array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false
653
            );
654
        }
655
    }
656
    $d->close();
657
}
658
659
// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties
660
$mp = &$modulePlugins;

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;