File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 6767 (and (stringp v)
6868 (string-match-p " \\ `[0-9]\\' " v))))))
6969
70+ ; ; Usually it is defined dynamically by flycheck
71+ (defvar flycheck-phpstan-executable )
72+
7073;;;### autoload
7174(progn
7275 (defvar phpstan-executable nil
103106 if dir
104107 return (expand-file-name name dir))))
105108
109+ (defun phpstan-get-config-file-and-set-flycheck-variable ()
110+ " Return path to phpstan configure file, and set buffer execute in side effect."
111+ (prog1 (phpstan-get-config-file)
112+ (when (and phpstan-flycheck-auto-set-executable
113+ (not (and (boundp 'flycheck-phpstan-executable )
114+ (symbol-value 'flycheck-phpstan-executable )))
115+ (stringp (car phpstan-executable))
116+ (listp (cdr phpstan-executable)))
117+ (set (make-local-variable 'flycheck-phpstan-executable )
118+ (car phpstan-executable)))))
119+
106120(defun phpstan-get-level ()
107121 " Return path to phpstan configure file or `NIL' ."
108122 (cond
139153 " -l" (eval (phpstan-get-level))
140154 source )
141155 :working-directory (lambda (_ ) (php-project-get-root-dir))
142- :enabled (lambda () (phpstan-get-config-file))
156+ :enabled (lambda () (phpstan-get-config-file-and-set-flycheck-variable ))
143157 :error-patterns
144158 ((error line-start (1+ (not (any " :" ))) " :" line " :" (message ) line-end))
145159 :modes (php-mode)
You can’t perform that action at this time.
0 commit comments