Code Duplication    Length = 21-21 lines in 2 locations

install/cli-install.php 1 location

@@ 692-712 (lines=21) @@
689
690
// setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties
691
$ms = &$moduleSnippets;
692
if (is_dir($snippetPath) && is_readable($snippetPath)) {
693
    $d = dir($snippetPath);
694
    while (false !== ($tplfile = $d->read())) {
695
        if (substr($tplfile, -4) != '.tpl') {
696
            continue;
697
        }
698
        $params = parse_docblock($snippetPath, $tplfile);
699
        if (is_array($params) && count($params) > 0) {
700
            $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}";
701
            $ms[] = array(
702
                $params['name'],
703
                $description,
704
                "$snippetPath/{$params['filename']}",
705
                $params['properties'],
706
                $params['modx_category'],
707
                array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false
708
            );
709
        }
710
    }
711
    $d->close();
712
}
713
714
// setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties
715
$mp = &$modulePlugins;

install/src/processor/result.php 1 location

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