Skip to content

Commit 273f89e

Browse files
committed
Fix phpstan-get-command-args and add autoload
1 parent 18b8e89 commit 273f89e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

phpstan.el

+7-6
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,15 @@ it returns the value of `SOURCE' as it is."
287287
(defun phpstan-get-command-args ()
288288
"Return command line argument for PHPStan."
289289
(let ((executable (phpstan-get-executable))
290-
(args (list "analyze" "--error-format=raw" "--no-progress" "--no-interaction"))
291290
(path (phpstan-normalize-path (phpstan-get-config-file)))
291+
(autoload (phpstan-get-autoload-file))
292292
(level (phpstan-get-level)))
293-
(when path
294-
(setq args (append args (list "-c" path))))
295-
(when level
296-
(setq args (append args (list "-l" level))))
297-
(append executable args)))
293+
(append executable
294+
(list "analyze" "--error-format=raw" "--no-progress" "--no-interaction")
295+
(and path (list "-c" path))
296+
(and autoload (list "-a" autoload))
297+
(and level (list "-l" level))
298+
(list "--"))))
298299

299300
(provide 'phpstan)
300301
;;; phpstan.el ends here

0 commit comments

Comments
 (0)