From 5f775c993f89deddc19a36853a1476daec81ee0b Mon Sep 17 00:00:00 2001 From: Naoya Yamashita Date: Fri, 11 Sep 2020 10:11:13 +0900 Subject: [PATCH 1/2] fix enabled-and-set-variable predicate phpstan-executable is valid if it like as below format - STRING - `docker' - `(root . STRING)' - `(STRING . (ARGUMENTS ...))' - NIL --- flycheck-phpstan.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flycheck-phpstan.el b/flycheck-phpstan.el index 3dac93e..873f30b 100644 --- a/flycheck-phpstan.el +++ b/flycheck-phpstan.el @@ -51,10 +51,13 @@ (when (and phpstan-flycheck-auto-set-executable (not (and (boundp 'flycheck-phpstan-executable) (symbol-value 'flycheck-phpstan-executable))) - (or (eq 'docker phpstan-executable) - (and (consp phpstan-executable) - (stringp (car phpstan-executable)) - (listp (cdr phpstan-executable))))) + (or (stringp phpstan-executable) + (eq 'docker phpstan-executable) + (and (eq 'root (car-safe phpstan-executable)) + (stringp (cdr-safe phpstan-executable))) + (and (stirngp (car-safe phpstan-executable)) + (listp (cdr-safe phpstan-executable))) + (null phpstan-executable))) (set (make-local-variable 'flycheck-phpstan-executable) (if (eq 'docker phpstan-executable) phpstan-docker-executable From 795c172c341a8ddcc6d75fbce4f00f8c61470cd4 Mon Sep 17 00:00:00 2001 From: Naoya Yamashita Date: Fri, 11 Sep 2020 10:18:36 +0900 Subject: [PATCH 2/2] fix get executable path method --- flycheck-phpstan.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flycheck-phpstan.el b/flycheck-phpstan.el index 873f30b..82d926f 100644 --- a/flycheck-phpstan.el +++ b/flycheck-phpstan.el @@ -59,9 +59,10 @@ (listp (cdr-safe phpstan-executable))) (null phpstan-executable))) (set (make-local-variable 'flycheck-phpstan-executable) - (if (eq 'docker phpstan-executable) - phpstan-docker-executable - (car phpstan-executable))))))) + (cond + ((eq 'docker phpstan-executable) phpstan-docker-executable) + ((stringp phpstan-executable) phpstan-executable) + (t (car phpstan-executable)))))))) (flycheck-define-checker phpstan "PHP static analyzer based on PHPStan."