Skip to content

Commit c48251b

Browse files
committed
Refactor using cl-loop
1 parent 968b8fe commit c48251b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

phpstan.el

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,11 @@
7070
(eq 'root (car phpstan-configure-file)))
7171
(expand-file-name (cdr phpstan-configure-file) (php-project-get-root-dir))
7272
phpstan-configure-file)
73-
(let ((dir (or (locate-dominating-file "phpstan.neon" default-directory)
74-
(locate-dominating-file "phpstan.neon.dist" default-directory)))
75-
file)
76-
(when dir
77-
(setq file (expand-file-name "phpstan.neon.dist" dir))
78-
(if (file-exists-p file)
79-
file
80-
(expand-file-name "phpstan.neon" dir))))))
73+
(cl-loop for name in '("phpstan.neon" "phpstan.neon.dist")
74+
for file = nil
75+
for dir = (locate-dominating-file default-directory name)
76+
if dir
77+
return (expand-file-name name dir))))
8178

8279
(defun phpstan-get-level ()
8380
"Return path to phpstan configure file or `NIL'."

0 commit comments

Comments
 (0)