function Finder::normalizeDir
Normalizes given directory names by removing trailing slashes.
Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper
1 call to Finder::normalizeDir()
- Finder::in in vendor/
symfony/ finder/ Finder.php - Searches files and directories which match defined rules.
File
-
vendor/
symfony/ finder/ Finder.php, line 838
Class
- Finder
- Finder allows to build rules to find files and directories.
Namespace
Symfony\Component\FinderCode
private function normalizeDir(string $dir) : string {
if ('/' === $dir) {
return $dir;
}
$dir = rtrim($dir, '/' . \DIRECTORY_SEPARATOR);
if (preg_match('#^(ssh2\\.)?s?ftp://#', $dir)) {
$dir .= '/';
}
return $dir;
}