File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 4646
4747(defun flycheck-phpstan--enabled-and-set-variable ()
4848 " 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 )))
5050 (prog1 enabled
5151 (when (and phpstan-flycheck-auto-set-executable
5252 (not (and (boundp 'flycheck-phpstan-executable )
Original file line number Diff line number Diff line change 104104(defun flymake-phpstan-turn-on ()
105105 " Enable flymake-phpstan as buffer-local Flymake backend."
106106 (interactive )
107- (let ((enabled (or phpstan-working-dir (phpstan-get-config-file) )))
107+ (let ((enabled (phpstan-enabled )))
108108 (when enabled
109109 (flymake-mode 1 )
110110 (when flymake-phpstan-disable-c-mode-hooks
Original file line number Diff line number Diff line change 200200 ((stringp phpstan-working-dir) phpstan-working-dir)
201201 (t (php-project-get-root-dir))))
202202
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+
203210(defun phpstan-get-config-file ()
204211 " Return path to phpstan configure file or `NIL' ."
205212 (if phpstan-config-file
You can’t perform that action at this time.
0 commit comments