Code Duplication    Length = 21-21 lines in 2 locations

install/cli-install.php 1 location

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

install/src/processor/result.php 1 location

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