Skip to content

Commit a2bbd6a

Browse files
committed
Accept variable phpstan-working-dir as string
1 parent c6587be commit a2bbd6a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

phpstan.el

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,11 @@ NIL
171171
;; Functions:
172172
(defun phpstan-get-working-dir ()
173173
"Return path to working directory of PHPStan."
174-
(if (and phpstan-working-dir (consp phpstan-working-dir) (eq 'root (car phpstan-working-dir)))
175-
(expand-file-name (cdr phpstan-working-dir) (php-project-get-root-dir))
176-
(php-project-get-root-dir)))
174+
(cond
175+
((and phpstan-working-dir (consp phpstan-working-dir) (eq 'root (car phpstan-working-dir)))
176+
(expand-file-name (cdr phpstan-working-dir) (php-project-get-root-dir)))
177+
((stringp phpstan-working-dir) phpstan-working-dir)
178+
(t (php-project-get-root-dir))))
177179

178180
(defun phpstan-get-config-file ()
179181
"Return path to phpstan configure file or `NIL'."

0 commit comments

Comments
 (0)