@@ -158,7 +158,7 @@ have unexpected behaviors or performance implications."
158
158
:group 'phpstan )
159
159
160
160
(defcustom phpstan-disable-buffer-errors nil
161
- " If T , don't keep errors per buffer to save memory."
161
+ " If non-NIL , don't keep errors per buffer to save memory."
162
162
:type 'boolean
163
163
:group 'phpstan )
164
164
@@ -172,7 +172,7 @@ have unexpected behaviors or performance implications."
172
172
173
173
;;;### autoload
174
174
(progn
175
- (defvar phpstan-working-dir nil
175
+ (defvar-local phpstan-working-dir nil
176
176
" Path to working directory of PHPStan.
177
177
178
178
*NOTICE*: This is different from the project root.
@@ -185,15 +185,14 @@ STRING
185
185
186
186
NIL
187
187
Use (php-project-get-root-dir) as working directory." )
188
- (make-variable-buffer-local 'phpstan-working-dir )
189
188
(put 'phpstan-working-dir 'safe-local-variable
190
189
#' (lambda (v ) (if (consp v)
191
190
(and (eq 'root (car v)) (stringp (cdr v)))
192
191
(null v) (stringp v)))))
193
192
194
193
;;;### autoload
195
194
(progn
196
- (defvar phpstan-config-file nil
195
+ (defvar-local phpstan-config-file nil
197
196
" Path to project specific configuration file of PHPStan.
198
197
199
198
STRING
@@ -204,7 +203,6 @@ STRING
204
203
205
204
NIL
206
205
Search phpstan.neon(.dist) in (phpstan-get-working-dir)." )
207
- (make-variable-buffer-local 'phpstan-config-file )
208
206
(put 'phpstan-config-file 'safe-local-variable
209
207
#' (lambda (v ) (if (consp v)
210
208
(and (eq 'root (car v)) (stringp (cdr v)))
@@ -243,25 +241,24 @@ max
243
241
NIL
244
242
Use rule level specified in `phpstan' configuration file." )
245
243
(put 'phpstan-level 'safe-local-variable
246
- #' (lambda (v ) (or (null v)
247
- (integerp v)
248
- (eq 'max v)
249
- (and (stringp v)
250
- (string= " max" v)
251
- (string-match-p " \\ `[0-9]\\' " v))))))
244
+ (lambda (v ) (or (null v)
245
+ (integerp v)
246
+ (eq 'max v)
247
+ (and (stringp v)
248
+ ( or (string= " max" v)
249
+ (string-match-p " \\ `[0-9]\\' " v) ))))))
252
250
253
251
;;;### autoload
254
252
(progn
255
- (defvar phpstan-replace-path-prefix )
256
- (make-variable-buffer-local 'phpstan-replace-path-prefix )
253
+ (defvar-local phpstan-replace-path-prefix nil )
257
254
(put 'phpstan-replace-path-prefix 'safe-local-variable
258
- #' (lambda (v ) (or (null v) (stringp v)))))
255
+ (lambda (v ) (or (null v) (stringp v)))))
259
256
260
257
(defconst phpstan-docker-executable " docker" )
261
258
262
259
;;;### autoload
263
260
(progn
264
- (defvar phpstan-executable nil
261
+ (defvar-local phpstan-executable nil
265
262
" PHPStan excutable file.
266
263
267
264
STRING
@@ -278,7 +275,6 @@ STRING
278
275
279
276
NIL
280
277
Auto detect `phpstan' executable file." )
281
- (make-variable-buffer-local 'phpstan-executable )
282
278
(put 'phpstan-executable 'safe-local-variable
283
279
#' (lambda (v ) (if (consp v)
284
280
(or (and (eq 'root (car v)) (stringp (cdr v)))
@@ -349,7 +345,8 @@ it returns the value of `SOURCE' as it is."
349
345
(cond
350
346
((eq 'docker phpstan-executable) " /app" )
351
347
((and (consp phpstan-executable)
352
- (string= " docker" (car phpstan-executable))) " /app" )))))
348
+ (string= " docker" (car phpstan-executable)))
349
+ " /app" )))))
353
350
(if prefix
354
351
(expand-file-name
355
352
(replace-regexp-in-string (concat " \\ `" (regexp-quote root-directory))
@@ -591,7 +588,7 @@ POSITION determines where to insert the comment and can be either `this-line' or
591
588
(goto-char new-point))
592
589
(insert (concat padding
593
590
(if new-position (if append " , " " " ) " // @phpstan-ignore " )
594
- (mapconcat # 'identity identifiers " , " )))))))
591
+ (string-join identifiers " , " )))))))
595
592
596
593
;;;### autoload
597
594
(defun phpstan-insert-dumptype (&optional expression prefix-num )
0 commit comments