diff --git a/flycheck-phpstan.el b/flycheck-phpstan.el index 036ffa3..ada4365 100644 --- a/flycheck-phpstan.el +++ b/flycheck-phpstan.el @@ -46,7 +46,7 @@ (defun flycheck-phpstan--enabled-and-set-variable () "Return path to phpstan configure file, and set buffer execute in side effect." - (let ((enabled (and (phpstan-get-working-dir) (phpstan-get-config-file)))) + (let ((enabled (or (phpstan-get-working-dir) (phpstan-get-config-file)))) (prog1 enabled (when (and phpstan-flycheck-auto-set-executable (not (and (boundp 'flycheck-phpstan-executable) diff --git a/phpstan.el b/phpstan.el index 37f8e3a..52f5bb6 100644 --- a/phpstan.el +++ b/phpstan.el @@ -181,10 +181,12 @@ NIL (expand-file-name (cdr phpstan-config-file) (php-project-get-root-dir)) phpstan-config-file) (let ((working-directory (phpstan-get-working-dir))) - (cl-loop for name in '("phpstan.neon" "phpstan.neon.dist") - for dir = (locate-dominating-file working-directory name) - if dir - return (expand-file-name name dir))))) + (if working-directory + nil + (cl-loop for name in '("phpstan.neon" "phpstan.neon.dist") + for dir = (locate-dominating-file working-directory name) + if dir + return (expand-file-name name dir)))))) (defun phpstan-normalize-path (source-original &optional source) "Return normalized source file path to pass by `SOURCE-ORIGINAL' OR `SOURCE'.