Skip to content

Commit 6651577

Browse files
authored
Merge pull request #34 from conao3/fix-phpstan-enable-pred
fix enabled-and-set-variable predicate
2 parents d067e41 + 795c172 commit 6651577

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

flycheck-phpstan.el

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@
5151
(when (and phpstan-flycheck-auto-set-executable
5252
(not (and (boundp 'flycheck-phpstan-executable)
5353
(symbol-value 'flycheck-phpstan-executable)))
54-
(or (eq 'docker phpstan-executable)
55-
(and (consp phpstan-executable)
56-
(stringp (car phpstan-executable))
57-
(listp (cdr phpstan-executable)))))
54+
(or (stringp phpstan-executable)
55+
(eq 'docker phpstan-executable)
56+
(and (eq 'root (car-safe phpstan-executable))
57+
(stringp (cdr-safe phpstan-executable)))
58+
(and (stirngp (car-safe phpstan-executable))
59+
(listp (cdr-safe phpstan-executable)))
60+
(null phpstan-executable)))
5861
(set (make-local-variable 'flycheck-phpstan-executable)
59-
(if (eq 'docker phpstan-executable)
60-
phpstan-docker-executable
61-
(car phpstan-executable)))))))
62+
(cond
63+
((eq 'docker phpstan-executable) phpstan-docker-executable)
64+
((stringp phpstan-executable) phpstan-executable)
65+
(t (car phpstan-executable))))))))
6266

6367
(flycheck-define-checker phpstan
6468
"PHP static analyzer based on PHPStan."

0 commit comments

Comments
 (0)