From 7e267cf44c954fd57cf5418619f053779e1ca50c Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Sun, 22 Nov 2020 14:43:52 +0900 Subject: [PATCH] Add phpstan-docker-image custom variable, default as official image --- README.org | 5 +++++ phpstan.el | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 4e18bcc..620fe2c 100644 --- a/README.org +++ b/README.org @@ -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]]. diff --git a/phpstan.el b/phpstan.el index f121788..36b17a3 100644 --- a/phpstan.el +++ b/phpstan.el @@ -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 @@ -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