From a296136afdb24812be415e53ad57ca43af23dab9 Mon Sep 17 00:00:00 2001 From: Yurun Date: Fri, 30 Jul 2021 08:46:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=81=E7=AB=AF=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E7=9A=84=20Imi\Util\Composer::getPathNamespa?= =?UTF-8?q?ces()=20=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Util/Composer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Util/Composer.php b/src/Util/Composer.php index ce60475a4..d97255c4f 100644 --- a/src/Util/Composer.php +++ b/src/Util/Composer.php @@ -52,10 +52,14 @@ abstract class Composer */ public static function getPathNamespaces(string $path): array { + $realPath = realpath($path); + if (!$realPath) + { + return []; + } $result = []; foreach (self::getClassLoaders() as $classLoader) { - $realPath = realpath($path); foreach ($classLoader->getPrefixesPsr4() as $namespace => $namespacePaths) { foreach ($namespacePaths as $namespacePath) -- GitLab