Skip to content

Commit 7e267cf

Browse files
committed
Add phpstan-docker-image custom variable, default as official image
1 parent e675cf0 commit 7e267cf

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

README.org

+5
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,13 @@ Rule level of PHPStan analysis. Please see [[https://github.com/phpstan/phpstan
124124

125125
*** Custom variable ~phpstan-flycheck-auto-set-executable~
126126
Set flycheck phpstan-executable automatically when non-NIL.
127+
127128
*** Custom variable ~phpstan-memory-limit~
128129
Use phpstan memory limit option when non-NIL.
129130
- STRING :: Specifies the memory limit in the same format php.ini accepts.
130131
- ex) ~"1G"~
131132
- ~nil~ :: Use memory limit in php.ini
133+
134+
*** Custom variable ~phpstan-docker-image~
135+
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]]
136+
and [[https://github.com/orgs/phpstan/packages/container/package/phpstan][GitHub Container Registory - Package phpstan]].

phpstan.el

+13-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@
8484
:safe (lambda (v) (or (null v) (stringp v)))
8585
:group 'phpstan)
8686

87+
(defcustom phpstan-docker-image "ghcr.io/phpstan/phpstan"
88+
"Docker image URL or Docker Hub image name or NIL."
89+
:type '(choice
90+
(string :tag "URL or image name of Docker Hub.")
91+
(const :tag "Official Docker container" "ghcr.io/phpstan/phpstan")
92+
(const :tag "No specify Docker image"))
93+
:link '(url-link :tag "PHPStan Documentation" "https://phpstan.org/user-guide/docker")
94+
:link '(url-link :tag "GitHub Container Registry"
95+
"https://github.com/orgs/phpstan/packages/container/package/phpstan")
96+
:safe (lambda (v) (or (null v) (stringp v)))
97+
:group 'phpstan)
98+
8799
;;;###autoload
88100
(progn
89101
(defvar phpstan-working-dir nil
@@ -281,7 +293,7 @@ it returns the value of `SOURCE' as it is."
281293
((eq 'docker phpstan-executable)
282294
(list "run" "--rm" "-v"
283295
(concat (expand-file-name (php-project-get-root-dir)) ":/app")
284-
"phpstan/phpstan"))
296+
phpstan-docker-image))
285297
((and (consp phpstan-executable)
286298
(eq 'root (car phpstan-executable)))
287299
(list

0 commit comments

Comments
 (0)