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
5 changes: 5 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,13 @@ Rule level of PHPStan analysis. Please see [[https://github.com/phpstan/phpstan

*** Custom variable ~phpstan-flycheck-auto-set-executable~
Set flycheck phpstan-executable automatically when non-NIL.

*** Custom variable ~phpstan-memory-limit~
Use phpstan memory limit option when non-NIL.
- STRING :: Specifies the memory limit in the same format php.ini accepts.
- ex) ~"1G"~
- ~nil~ :: Use memory limit in php.ini

*** Custom variable ~phpstan-docker-image~
Docker image URL or Docker Hub image name or NIL. Default as ~"ghcr.io/phpstan/phpstan"~. See [[https://phpstan.org/user-guide/docker][Docker - PHPStan Documentation]]
and [[https://github.com/orgs/phpstan/packages/container/package/phpstan][GitHub Container Registory - Package phpstan]].
14 changes: 13 additions & 1 deletion phpstan.el
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@
:safe (lambda (v) (or (null v) (stringp v)))
:group 'phpstan)

(defcustom phpstan-docker-image "ghcr.io/phpstan/phpstan"
"Docker image URL or Docker Hub image name or NIL."
:type '(choice
(string :tag "URL or image name of Docker Hub.")
(const :tag "Official Docker container" "ghcr.io/phpstan/phpstan")
(const :tag "No specify Docker image"))
:link '(url-link :tag "PHPStan Documentation" "https://phpstan.org/user-guide/docker")
:link '(url-link :tag "GitHub Container Registry"
"https://github.com/orgs/phpstan/packages/container/package/phpstan")
:safe (lambda (v) (or (null v) (stringp v)))
:group 'phpstan)

;;;###autoload
(progn
(defvar phpstan-working-dir nil
Expand Down Expand Up @@ -281,7 +293,7 @@ it returns the value of `SOURCE' as it is."
((eq 'docker phpstan-executable)
(list "run" "--rm" "-v"
(concat (expand-file-name (php-project-get-root-dir)) ":/app")
"phpstan/phpstan"))
phpstan-docker-image))
((and (consp phpstan-executable)
(eq 'root (car phpstan-executable)))
(list
Expand Down