Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

All notable changes of the phpactor.el are documented in this file using the [Keep a Changelog](https://keepachangelog.com/) principles.

## Unreleased

### Added

* Add `phpstan-analyze-this-file` command
9 changes: 8 additions & 1 deletion phpstan.el
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,15 @@ it returns the value of `SOURCE' as it is."
"Return --memory-limit value."
phpstan-memory-limit)

(defun phpstan-analyze-this-file ()
"Analyze current buffer-file using PHPStan."
(interactive)
(let ((file (expand-file-name (or buffer-file-name
(read-file-name "Choose a PHP script: ")))))
(compile (mapconcat #'shell-quote-argument (append (phpstan-get-command-args t) (list file)) " "))))

(defun phpstan-analyze-file (file)
"Analyze a PHPScript FILE using PHPStan."
"Analyze a PHP script FILE using PHPStan."
(interactive (list (expand-file-name (read-file-name "Choose a PHP script: "))))
(compile (mapconcat #'shell-quote-argument (append (phpstan-get-command-args t) (list file)) " ")))

Expand Down