summaryrefslogtreecommitdiff
path: root/vendor/symfony/finder/Finder.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-04-20 16:05:50 -0700
committerFrédéric Guillot <fred@kanboard.net>2018-04-20 16:05:50 -0700
commitbb406d57b1c1ad2736774be18b2f7b4d31abcf63 (patch)
treea4a89775f5519c178679f99115dd3b84efd051cb /vendor/symfony/finder/Finder.php
parent32a95ce5ea08ec5b263224865b0695c7459928b0 (diff)
Update Parsedown library
Diffstat (limited to 'vendor/symfony/finder/Finder.php')
-rw-r--r--vendor/symfony/finder/Finder.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/vendor/symfony/finder/Finder.php b/vendor/symfony/finder/Finder.php
index c28aaf74..278b9841 100644
--- a/vendor/symfony/finder/Finder.php
+++ b/vendor/symfony/finder/Finder.php
@@ -540,9 +540,9 @@ class Finder implements \IteratorAggregate, \Countable
foreach ((array) $dirs as $dir) {
if (is_dir($dir)) {
- $resolvedDirs[] = $dir;
+ $resolvedDirs[] = $this->normalizeDir($dir);
} elseif ($glob = glob($dir, (defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
- $resolvedDirs = array_merge($resolvedDirs, $glob);
+ $resolvedDirs = array_merge($resolvedDirs, array_map(array($this, 'normalizeDir'), $glob));
} else {
throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
}
@@ -728,4 +728,16 @@ class Finder implements \IteratorAggregate, \Countable
return $iterator;
}
+
+ /**
+ * Normalizes given directory names by removing trailing slashes.
+ *
+ * @param string $dir
+ *
+ * @return string
+ */
+ private function normalizeDir($dir)
+ {
+ return rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
+ }
}