Skip to content

Commit 23d1860

Browse files
committed
Normalize phpstan-config-file for Docker
1 parent 70cb256 commit 23d1860

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

phpstan.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ NIL
133133
phpstan-docker-executable
134134
(car phpstan-executable))))))
135135

136-
(defun phpstan-normalize-path (source-original source)
136+
(defun phpstan-normalize-path (source-original &optional source)
137137
"Return normalized source file path to pass by `SOURCE-ORIGINAL' OR `SOURCE'.
138138
139139
If neither `phpstan-replace-path-prefix' nor executable docker is set,
@@ -151,7 +151,7 @@ it returns the value of `SOURCE' as it is."
151151
""
152152
source-original t t)
153153
prefix)
154-
source)))
154+
(or source source-original))))
155155

156156
(defun phpstan-get-level ()
157157
"Return path to phpstan configure file or `NIL'."
@@ -189,7 +189,7 @@ it returns the value of `SOURCE' as it is."
189189
"PHP static analyzer based on PHPStan."
190190
:command ("php" (eval (phpstan-get-executable))
191191
"analyze" "--errorFormat=raw" "--no-progress" "--no-interaction"
192-
"-c" (eval (phpstan-get-config-file))
192+
"-c" (eval (phpstan-normalize-path (phpstan-get-config-file)))
193193
"-l" (eval (phpstan-get-level))
194194
(eval (phpstan-normalize-path
195195
(flycheck-save-buffer-to-temp #'flycheck-temp-file-inplace)

test-docker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
// Local Variables:
1111
// phpstan-executable: docker
12-
// phpstan-config-file: "/app/tests/phpstan-docker.neon"
12+
// phpstan-config-file: (root . "tests/phpstan-docker.neon")
1313
// phpstan-level: 7
1414
// End:

0 commit comments

Comments
 (0)