diff --git a/Autoloader.php b/Autoloader.php index fcf4fb343..5f13c93b1 100644 --- a/Autoloader.php +++ b/Autoloader.php @@ -69,11 +69,7 @@ class Autoloader $class = ltrim($class, '\\'); $class = str_replace(['_', '\\'], '/', $class); - if (file_exists(__DIR__ . '/../' . $class . '.php')) { - return $class; - } - - return false; + return file_exists(__DIR__ . '/../' . $class . '.php'); } } diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index f5b2790fa..59fb6629a 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -55,7 +55,7 @@ class ArrayUtils */ public static function unsetArray(string $path, array $data, string $delim) : array { - $nodes = explode($delim, $path); + $nodes = explode($delim, trim($path, $delim)); $prevEl = null; $el = &$data; @@ -94,7 +94,7 @@ class ArrayUtils */ public static function setArray(string $path, array $data, $value, string $delim, bool $overwrite = false) : array { - $pathParts = explode($delim, $path); + $pathParts = explode($delim, trim($path, $delim)); $current = &$data; foreach ($pathParts as $key) {