File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 46
46
47
47
(defun flycheck-phpstan--enabled-and-set-variable ()
48
48
" Return path to phpstan configure file, and set buffer execute in side effect."
49
- (let ((enabled (or phpstan-working-dir (phpstan-get-config-file) )))
49
+ (let ((enabled (phpstan-enabled )))
50
50
(prog1 enabled
51
51
(when (and phpstan-flycheck-auto-set-executable
52
52
(not (and (boundp 'flycheck-phpstan-executable )
Original file line number Diff line number Diff line change 104
104
(defun flymake-phpstan-turn-on ()
105
105
" Enable flymake-phpstan as buffer-local Flymake backend."
106
106
(interactive )
107
- (let ((enabled (or phpstan-working-dir (phpstan-get-config-file) )))
107
+ (let ((enabled (phpstan-enabled )))
108
108
(when enabled
109
109
(flymake-mode 1 )
110
110
(when flymake-phpstan-disable-c-mode-hooks
Original file line number Diff line number Diff line change 200
200
((stringp phpstan-working-dir) phpstan-working-dir)
201
201
(t (php-project-get-root-dir))))
202
202
203
+ (defun phpstan-enabled ()
204
+ " Return non-NIL if PHPStan configured or Composer detected."
205
+ (or (phpstan-get-config-file)
206
+ (phpstan-get-autoload-file)
207
+ (and phpstan-enable-on-no-config-file
208
+ (php-project-get-root-dir))))
209
+
203
210
(defun phpstan-get-config-file ()
204
211
" Return path to phpstan configure file or `NIL' ."
205
212
(if phpstan-config-file
You can’t perform that action at this time.
0 commit comments