Skip to content

Commit a4b3f55

Browse files
authored
Merge pull request #59 from emacs-php/fix/custom-variable-local
Explicitly set the custom variable to :local t
2 parents cf5e7ab + 3f8783c commit a4b3f55

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

flymake-phpstan.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
(require 'cl-lib)
3939
(require 'php-project)
4040
(require 'flymake)
41+
(require 'flymake-proc)
4142
(require 'phpstan)
4243
(eval-when-compile
4344
(require 'pcase))

phpstan.el

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,11 @@
7777

7878
(defcustom phpstan-flycheck-auto-set-executable t
7979
"Set flycheck phpstan-executable automatically."
80-
:type 'boolean
81-
:group 'phpstan)
80+
:type 'boolean)
8281

8382
(defcustom phpstan-enable-on-no-config-file t
8483
"If T, activate config from composer even when `phpstan.neon' is not found."
85-
:type 'boolean
86-
:group 'phpstan)
84+
:type 'boolean)
8785

8886
(defcustom phpstan-memory-limit nil
8987
"Set --memory-limit option."
@@ -92,7 +90,7 @@
9290
:link '(url-link :tag "PHP Manual"
9391
"https://www.php.net/manual/ini.core.php#ini.memory-limit")
9492
:safe (lambda (v) (or (null v) (stringp v)))
95-
:group 'phpstan)
93+
:local t)
9694

9795
(defcustom phpstan-docker-image "ghcr.io/phpstan/phpstan"
9896
"Docker image URL or Docker Hub image name or NIL."
@@ -104,39 +102,39 @@
104102
:link '(url-link :tag "GitHub Container Registry"
105103
"https://github.com/orgs/phpstan/packages/container/package/phpstan")
106104
:safe (lambda (v) (or (null v) (stringp v)))
107-
:group 'phpstan)
105+
:local t)
108106

109107
(defcustom phpstan-use-xdebug-option nil
110108
"Set --xdebug option."
111109
:type '(choice (const :tag "Set --xdebug option dynamically" auto)
112110
(const :tag "Add --xdebug option" t)
113111
(const :tag "No --xdebug option" nil))
114112
:safe #'symbolp
115-
:group 'phpstan)
113+
:local t)
116114

117115
(defcustom phpstan-generate-baseline-options '("--generate-baseline" "--allow-empty-baseline")
118116
"Command line options for generating PHPStan baseline."
119117
:type '(repeat string)
120118
:safe #'listp
121-
:group 'phpstan)
119+
:local t)
122120

123121
(defcustom phpstan-baseline-file "phpstan-baseline.neon"
124122
"File name of PHPStan baseline file."
125123
:type 'string
126124
:safe #'stringp
127-
:group 'phpstan)
125+
:local t)
128126

129127
(defcustom phpstan-tip-message-prefix "💡 "
130128
"Prefix of PHPStan tip message."
131129
:type 'string
132130
:safe #'stringp
133-
:group 'phpstan)
131+
:local t)
134132

135133
(defcustom phpstan-identifier-prefix "🪪 "
136134
"Prefix of PHPStan error identifier."
137135
:type 'string
138136
:safe #'stringp
139-
:group 'phpstan)
137+
:local t)
140138

141139
(defcustom phpstan-enable-remote-experimental nil
142140
"Enable PHPStan analysis remotely by TRAMP.
@@ -146,32 +144,31 @@ This feature is experimental and should be used with caution as it may
146144
have unexpected behaviors or performance implications."
147145
:type 'boolean
148146
:safe #'booleanp
149-
:group 'phpstan)
147+
:local t)
150148

151149
(defconst phpstan-template-dump-type "\\PHPStan\\dumpType();")
152150
(defconst phpstan-template-dump-phpdoc-type "\\PHPStan\\dumpPhpDocType();")
153151

154152
(defcustom phpstan-intert-dump-type-templates (cons phpstan-template-dump-type
155153
phpstan-template-dump-phpdoc-type)
156154
"Default template of PHPStan dumpType insertion."
157-
:type '(cons string string)
158-
:group 'phpstan)
155+
:type '(cons string string))
159156

160157
(defcustom phpstan-disable-buffer-errors nil
161158
"If non-NIL, don't keep errors per buffer to save memory."
162-
:type 'boolean
163-
:group 'phpstan)
159+
:type 'boolean)
164160

165161
(defcustom phpstan-not-ignorable-identifiers '("ignore.parseError")
166162
"Lists identifiers prohibited from being added to @phpstan-ignore tags."
167163
:type '(repeat string))
168164

169165
(defcustom phpstan-activate-editor-mode nil
170166
"Controls how PHPStan's editor mode is activated."
171-
:local t
172167
:type '(choice (const :tag "Automatic (based on version)" nil)
173-
(const :tag "Editor mode will be actively enabled, regardless of the PHPStan version." 'enabled)
174-
(const :tag "Editor mode will be explicitly disabled." 'disabled)))
168+
(const :tag "Editor mode will be actively enabled, regardless of the PHPStan version." enabled)
169+
(const :tag "Editor mode will be explicitly disabled." disabled))
170+
:safe (lambda (v) (memq v '(nil enabled disabled)))
171+
:local t)
175172

176173
(defvar-local phpstan--use-xdebug-option nil)
177174

@@ -573,7 +570,7 @@ it returns the value of `SOURCE' as it is."
573570
574571
If a cached result for EXECUTABLE exists, it is returned directly.
575572
Otherwise, this function attempts to determine support by retrieving
576-
the PHPStan version using 'phpstan --version' command."
573+
the PHPStan version using `phpstan --version' command."
577574
(pcase phpstan-activate-editor-mode
578575
('enabled t)
579576
('disabled nil)

0 commit comments

Comments
 (0)