From e436b3fae05bc558848a7d266b913d9193c07029 Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Sun, 25 Feb 2024 14:57:00 +0100 Subject: [PATCH] Ignore non-existant directories in psr4 autoload config --- phpinspect-autoload.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/phpinspect-autoload.el b/phpinspect-autoload.el index 1b5730e..49f0d5b 100644 --- a/phpinspect-autoload.el +++ b/phpinspect-autoload.el @@ -139,12 +139,13 @@ bareword typenames.")) (prefix (phpinspect-psr4-prefix strat)) type-fqn) (dolist (dir (phpinspect-psr4-directories strat)) - (dolist (file (phpinspect-fs-directory-files-recursively fs dir "\\.php$")) - (setq type-fqn (phpinspect-filename-to-typename dir file prefix)) - (phpinspect-autoloader-put-type-bag al type-fqn) - (puthash type-fqn file typehash) - (when own - (puthash type-fqn file own-typehash)))))) + (when (phpinspect-fs-file-directory-p fs dir) + (dolist (file (phpinspect-fs-directory-files-recursively fs dir "\\.php$")) + (setq type-fqn (phpinspect-filename-to-typename dir file prefix)) + (phpinspect-autoloader-put-type-bag al type-fqn) + (puthash type-fqn file typehash) + (when own + (puthash type-fqn file own-typehash))))))) (cl-defmethod phpinspect-al-strategy-execute ((strat phpinspect-psr0)) (let* ((fs (phpinspect-psr0-fs strat))