Code Duplication    Length = 5-7 lines in 3 locations

core/src/Core.php 1 location

@@ 1212-1217 (lines=6) @@
1209
            case 'uparent':
1210
            case 'up':
1211
            case 'u':
1212
                if (strpos($str, '(') !== false) {
1213
                    $top = substr($str, strpos($str, '('));
1214
                    $top = trim($top, '()"\'');
1215
                } else {
1216
                    $top = 0;
1217
                }
1218
                $docid = $this->getUltimateParentId($this->documentIdentifier, $top);
1219
                break;
1220
            case 'alias':

core/src/Legacy/ManagerApi.php 1 location

@@ 190-194 (lines=5) @@
187
        $rs = $modx->getDatabase()->select('password', $tbl_manager_users, "id='{$uid}'");
188
        $password = $modx->getDatabase()->getValue($rs);
189
190
        if (strpos($password, '>') === false) {
191
            $algo = 'NOSALT';
192
        } else {
193
            $algo = substr($password, 0, strpos($password, '>'));
194
        }
195
196
        return strtoupper($algo);
197
    }

core/src/Legacy/Modifiers.php 1 location

@@ 300-306 (lines=7) @@
297
            $value = $modx->documentIdentifier;
298
        }
299
        $cmd = $this->parseDocumentSource($cmd);
300
        if (preg_match('@^[1-9][/0-9]*$@', $cmd)) {
301
            if (strpos($cmd, '/') !== false) {
302
                $cmd = $this->substr($cmd, strrpos($cmd, '/') + 1);
303
            }
304
            $opt = $cmd;
305
            $cmd = 'id';
306
        }
307
308
        if (isset($modx->snippetCache["phx:{$cmd}"])) {
309
            $this->elmName = "phx:{$cmd}";