/**
* @codeCoverageIgnore
+ *
+ * @param string[] $paths
+ *
+ * @return array
+ */
+ private function __filterTrimPaths(array &$paths)
+ {
+ return array_map(function ($p) {
+ return rtrim($p, "/\\") . DIRECTORY_SEPARATOR;
+ }, array_filter($paths, function ($p) {
+ return !empty($p) && is_string($p);
+ }));
+ }
+
+ /**
+ * normalize arguments
+ *
+ * either `$namespace` and $path` are both strings or
+ * `$namespace` is an array containing namespaces and path pairs
+ * and `$path` is null
+ *
+ * if the parameters are invalid an `\InvalidArgumentException`
+ * is thrown.
+ *
+ * @CodeCoverageIgnore
+ *
+ * @param $namespace
+ * @param $path
+ *
+ * @return array|string
+ *
+ * @throws \InvalidArgumentException
+ */
+ private function __getValidNamespacePaths($namespace, $path)
+ {
+ if (is_string($namespace) && is_string($path)) {
+ $namespace = array($namespace => $path);
+ $path = null;
+ }
+
+ if ($path !== null || !is_array($namespace)) {
+ throw new \InvalidArgumentException("Invalid argument");
+ }
+
+ foreach ($namespace as $n => &$p) {
+ $p = str_replace("\\/", DIRECTORY_SEPARATOR, $p);
+ }
+
+ return $namespace;
+ }
+
+ /**
+ * @codeCoverageIgnore
*/
private function __registerAutoloader()
{
}
/**
- * @codeCoverageIgnore
- *
- * @param string[] $paths
- *
- * @return array
- */
- private function __filterTrimPaths(array &$paths)
- {
- return array_map(function ($p) {
- return rtrim($p, "/\\") . DIRECTORY_SEPARATOR;
- }, array_filter($paths, function ($p) {
- return !empty($p) && is_string($p);
- }));
- }
-
- /**
* add path to autoload path(s)
*
* @codeCoverageIgnore
}
/**
- * normalize arguments
- *
- * either `$namespace` and $path` are both strings or
- * `$namespace` is an array containing namespaces and path pairs
- * and `$path` is null
- *
- * if the parameters are invalid an `\InvalidArgumentException`
- * is thrown.
- *
- * @CodeCoverageIgnore
- *
- * @param $namespace
- * @param $path
- *
- * @return array|string
- *
- * @throws \InvalidArgumentException
- */
- private function __getValidNamespacePaths($namespace, $path)
- {
- if (is_string($namespace) && is_string($path)) {
- $namespace = array($namespace => $path);
- $path = null;
- }
-
- if ($path !== null || !is_array($namespace)) {
- throw new \InvalidArgumentException("Invalid argument");
- }
-
- foreach ($namespace as $n => &$p) {
- $p = str_replace("\\/", DIRECTORY_SEPARATOR, $p);
- }
-
- return $namespace;
- }
-
- /**
* add path to autoload path(s) that is prefixed with a namespace
*
* @param string|array $namespace