Skip to content

Commit 56355b0

Browse files
committed
Search phpstan.neon from (phpstan-get-working-dir)
1 parent 4d53e60 commit 56355b0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

phpstan.el

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,14 @@ NIL
139139
(if phpstan-config-file
140140
(if (and (consp phpstan-config-file)
141141
(eq 'root (car phpstan-config-file)))
142+
;; Use (php-project-get-root-dir), not phpstan-working-dir.
142143
(expand-file-name (cdr phpstan-config-file) (php-project-get-root-dir))
143144
phpstan-config-file)
144-
(cl-loop for name in '("phpstan.neon" "phpstan.neon.dist")
145-
for dir = (locate-dominating-file default-directory name)
146-
if dir
147-
return (expand-file-name name dir))))
145+
(let ((working-directory (phpstan-get-working-dir)))
146+
(cl-loop for name in '("phpstan.neon" "phpstan.neon.dist")
147+
for dir = (locate-dominating-file working-directory name)
148+
if dir
149+
return (expand-file-name name dir)))))
148150

149151
(defun phpstan-get-config-file-and-set-flycheck-variable ()
150152
"Return path to phpstan configure file, and set buffer execute in side effect."

0 commit comments

Comments
 (0)