From 859692ed368dfde1aa325429ff4542e8678132b2 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Thu, 17 Jun 2021 19:26:47 +0900 Subject: [PATCH] Use phpstan-get-executable instead of mekeshift processing --- flycheck-phpstan.el | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/flycheck-phpstan.el b/flycheck-phpstan.el index 1e0932a..a6d0a67 100644 --- a/flycheck-phpstan.el +++ b/flycheck-phpstan.el @@ -49,8 +49,7 @@ (let ((enabled (phpstan-enabled))) (prog1 enabled (when (and phpstan-flycheck-auto-set-executable - (not (and (boundp 'flycheck-phpstan-executable) - (symbol-value 'flycheck-phpstan-executable))) + (null (bound-and-true-p flycheck-phpstan-executable)) (or (stringp phpstan-executable) (eq 'docker phpstan-executable) (and (eq 'root (car-safe phpstan-executable)) @@ -58,11 +57,7 @@ (and (stringp (car-safe phpstan-executable)) (listp (cdr-safe phpstan-executable))) (null phpstan-executable))) - (set (make-local-variable 'flycheck-phpstan-executable) - (cond - ((eq 'docker phpstan-executable) phpstan-docker-executable) - ((stringp phpstan-executable) phpstan-executable) - (t (car phpstan-executable)))))))) + (setq-local flycheck-phpstan-executable (nth 0 (phpstan-get-executable))))))) (flycheck-define-checker phpstan "PHP static analyzer based on PHPStan."