|
36 | 36 |
|
37 | 37 | ;;;###autoload
|
38 | 38 | (progn
|
39 |
| - (defvar phpstan-configure-file nil) |
40 |
| - (make-variable-buffer-local 'phpstan-configure-file) |
41 |
| - (put 'phpstan-configure-file 'safe-local-variable |
| 39 | + (defvar phpstan-config-file nil) |
| 40 | + (make-variable-buffer-local 'phpstan-config-file) |
| 41 | + (put 'phpstan-config-file 'safe-local-variable |
42 | 42 | #'(lambda (v) (if (consp v)
|
43 | 43 | (and (eq 'root (car v)) (stringp (cdr v)))
|
44 | 44 | (null v) (stringp v)))))
|
|
63 | 63 | (null v) (stringp v)))))
|
64 | 64 |
|
65 | 65 | ;; Functions:
|
66 |
| -(defun phpstan-get-configure-file () |
| 66 | +(defun phpstan-get-config-file () |
67 | 67 | "Return path to phpstan configure file or `NIL'."
|
68 |
| - (if phpstan-configure-file |
69 |
| - (if (and (consp phpstan-configure-file) |
70 |
| - (eq 'root (car phpstan-configure-file))) |
71 |
| - (expand-file-name (cdr phpstan-configure-file) (php-project-get-root-dir)) |
72 |
| - phpstan-configure-file) |
| 68 | + (if phpstan-config-file |
| 69 | + (if (and (consp phpstan-config-file) |
| 70 | + (eq 'root (car phpstan-config-file))) |
| 71 | + (expand-file-name (cdr phpstan-config-file) (php-project-get-root-dir)) |
| 72 | + phpstan-config-file) |
73 | 73 | (cl-loop for name in '("phpstan.neon" "phpstan.neon.dist")
|
74 | 74 | for file = nil
|
75 | 75 | for dir = (locate-dominating-file default-directory name)
|
|
102 | 102 | "PHP static analyzer based on PHPStan."
|
103 | 103 | :command ("php" (eval (phpstan-get-executable))
|
104 | 104 | "analyze" "--errorFormat=raw" "--no-progress" "--no-interaction"
|
105 |
| - "-c" (eval (phpstan-get-configure-file)) |
| 105 | + "-c" (eval (phpstan-get-config-file)) |
106 | 106 | "-l" (eval (phpstan-get-level))
|
107 | 107 | source)
|
108 | 108 | :working-directory (lambda (_) (php-project-get-root-dir))
|
109 |
| - :enabled (lambda () (phpstan-get-configure-file)) |
| 109 | + :enabled (lambda () (phpstan-get-config-file)) |
110 | 110 | :error-patterns
|
111 | 111 | ((error line-start (1+ (not (any ":"))) ":" line ":" (message) line-end))
|
112 | 112 | :modes (php-mode)
|
|
0 commit comments