Skip to content

Commit 9350e23

Browse files
authored
Merge pull request #39 from emacs-php/fix/flycheck-phpstan-executable
Use phpstan-get-executable instead of makeshift processing
2 parents 6863a52 + 859692e commit 9350e23

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

flycheck-phpstan.el

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,15 @@
4949
(let ((enabled (phpstan-enabled)))
5050
(prog1 enabled
5151
(when (and phpstan-flycheck-auto-set-executable
52-
(not (and (boundp 'flycheck-phpstan-executable)
53-
(symbol-value 'flycheck-phpstan-executable)))
52+
(null (bound-and-true-p flycheck-phpstan-executable))
5453
(or (stringp phpstan-executable)
5554
(eq 'docker phpstan-executable)
5655
(and (eq 'root (car-safe phpstan-executable))
5756
(stringp (cdr-safe phpstan-executable)))
5857
(and (stringp (car-safe phpstan-executable))
5958
(listp (cdr-safe phpstan-executable)))
6059
(null phpstan-executable)))
61-
(set (make-local-variable 'flycheck-phpstan-executable)
62-
(cond
63-
((eq 'docker phpstan-executable) phpstan-docker-executable)
64-
((stringp phpstan-executable) phpstan-executable)
65-
(t (car phpstan-executable))))))))
60+
(setq-local flycheck-phpstan-executable (nth 0 (phpstan-get-executable)))))))
6661

6762
(flycheck-define-checker phpstan
6863
"PHP static analyzer based on PHPStan."

0 commit comments

Comments
 (0)