File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -344,14 +344,18 @@ it returns the value of `SOURCE' as it is."
344344(defun phpstan-analyze-project ()
345345 " Analyze a PHP project using PHPStan."
346346 (interactive )
347- (compile (mapconcat #'shell-quote-argument (phpstan-get-command-args :include-executable t ) " " )))
347+ (let ((default-directory (or (php-project-get-root-dir) default-directory)))
348+ (compile (mapconcat #'shell-quote-argument (phpstan-get-command-args :include-executable t ) " " ))))
348349
349350;;;### autoload
350351(defun phpstan-generate-baseline ()
351352 " Generate PHPStan baseline file."
352353 (interactive )
353- (compile (mapconcat #'shell-quote-argument
354- (phpstan-get-command-args :include-executable t :options '(" --generate-baseline" )) " " )))
354+ (let ((default-directory (or (locate-dominating-file default-directory phpstan-baseline-file)
355+ (php-project-get-root-dir)
356+ default-directory)))
357+ (compile (mapconcat #'shell-quote-argument
358+ (phpstan-get-command-args :include-executable t :options '(" --generate-baseline" )) " " ))))
355359
356360;;;### autoload
357361(defun phpstan-find-baseline-file ()
You can’t perform that action at this time.
0 commit comments