Skip to content

Commit e90ed7c

Browse files
committed
Requires Emacs 25 or higher
1 parent e1aa8b2 commit e90ed7c

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

flycheck-phpstan.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
;; Version: 0.8.2
88
;; Keywords: tools, php
99
;; Homepage: https://github.com/emacs-php/phpstan.el
10-
;; Package-Requires: ((emacs "24.3") (flycheck "26") (phpstan "0.8.2"))
10+
;; Package-Requires: ((emacs "25.1") (flycheck "26") (phpstan "0.8.2"))
1111
;; License: GPL-3.0-or-later
1212

1313
;; This program is free software; you can redistribute it and/or modify
@@ -107,7 +107,7 @@
107107
(if (null lines)
108108
msg
109109
(concat msg flycheck-phpstan-metadata-separator
110-
(mapconcat #'identity lines "\n"))))
110+
(string-join lines "\n"))))
111111
collect (flycheck-error-new-at (plist-get messages :line)
112112
nil 'error text
113113
:filename file))))

phpstan.el

+15-18
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ have unexpected behaviors or performance implications."
158158
:group 'phpstan)
159159

160160
(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."
162162
:type 'boolean
163163
:group 'phpstan)
164164

@@ -172,7 +172,7 @@ have unexpected behaviors or performance implications."
172172

173173
;;;###autoload
174174
(progn
175-
(defvar phpstan-working-dir nil
175+
(defvar-local phpstan-working-dir nil
176176
"Path to working directory of PHPStan.
177177
178178
*NOTICE*: This is different from the project root.
@@ -185,15 +185,14 @@ STRING
185185
186186
NIL
187187
Use (php-project-get-root-dir) as working directory.")
188-
(make-variable-buffer-local 'phpstan-working-dir)
189188
(put 'phpstan-working-dir 'safe-local-variable
190189
#'(lambda (v) (if (consp v)
191190
(and (eq 'root (car v)) (stringp (cdr v)))
192191
(null v) (stringp v)))))
193192

194193
;;;###autoload
195194
(progn
196-
(defvar phpstan-config-file nil
195+
(defvar-local phpstan-config-file nil
197196
"Path to project specific configuration file of PHPStan.
198197
199198
STRING
@@ -204,7 +203,6 @@ STRING
204203
205204
NIL
206205
Search phpstan.neon(.dist) in (phpstan-get-working-dir).")
207-
(make-variable-buffer-local 'phpstan-config-file)
208206
(put 'phpstan-config-file 'safe-local-variable
209207
#'(lambda (v) (if (consp v)
210208
(and (eq 'root (car v)) (stringp (cdr v)))
@@ -243,25 +241,24 @@ max
243241
NIL
244242
Use rule level specified in `phpstan' configuration file.")
245243
(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)))))))
252250

253251
;;;###autoload
254252
(progn
255-
(defvar phpstan-replace-path-prefix)
256-
(make-variable-buffer-local 'phpstan-replace-path-prefix)
253+
(defvar-local phpstan-replace-path-prefix nil)
257254
(put 'phpstan-replace-path-prefix 'safe-local-variable
258-
#'(lambda (v) (or (null v) (stringp v)))))
255+
(lambda (v) (or (null v) (stringp v)))))
259256

260257
(defconst phpstan-docker-executable "docker")
261258

262259
;;;###autoload
263260
(progn
264-
(defvar phpstan-executable nil
261+
(defvar-local phpstan-executable nil
265262
"PHPStan excutable file.
266263
267264
STRING
@@ -278,7 +275,6 @@ STRING
278275
279276
NIL
280277
Auto detect `phpstan' executable file.")
281-
(make-variable-buffer-local 'phpstan-executable)
282278
(put 'phpstan-executable 'safe-local-variable
283279
#'(lambda (v) (if (consp v)
284280
(or (and (eq 'root (car v)) (stringp (cdr v)))
@@ -349,7 +345,8 @@ it returns the value of `SOURCE' as it is."
349345
(cond
350346
((eq 'docker phpstan-executable) "/app")
351347
((and (consp phpstan-executable)
352-
(string= "docker" (car phpstan-executable))) "/app")))))
348+
(string= "docker" (car phpstan-executable)))
349+
"/app")))))
353350
(if prefix
354351
(expand-file-name
355352
(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
591588
(goto-char new-point))
592589
(insert (concat padding
593590
(if new-position (if append ", " " ") "// @phpstan-ignore ")
594-
(mapconcat #'identity identifiers ", ")))))))
591+
(string-join identifiers ", ")))))))
595592

596593
;;;###autoload
597594
(defun phpstan-insert-dumptype (&optional expression prefix-num)

0 commit comments

Comments
 (0)