Skip to content

Commit 6e4a465

Browse files
committed
Use if-let* / when-let* instead of the obsolete plain forms
`if-let' and `when-let' are obsolete as of Emacs 31.1, and the byte compiler warns about all three uses here. Each binds a single value, so the starred forms are a direct, behaviour-preserving replacement. Both are available on the supported Emacs (27.1+) through subr-x.
1 parent c38ddd8 commit 6e4a465

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

phpstan-hover.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
"Return hover type string at point.
244244
245245
If PREFER-PHPDOC is non-nil, return PHPDoc type when available."
246-
(when-let ((datum (phpstan-hover--datum-at-point)))
246+
(when-let* ((datum (phpstan-hover--datum-at-point)))
247247
(let ((type (plist-get datum :typeDescr))
248248
(phpdoc-type (plist-get datum :phpDocType)))
249249
(if (and prefer-phpdoc
@@ -332,7 +332,7 @@ This honors `phpstan-hover-display-backend'."
332332

333333
(defun phpstan-hover--show-at-point ()
334334
"Show hover text for current point if available."
335-
(if-let ((datum (phpstan-hover--datum-at-point)))
335+
(if-let* ((datum (phpstan-hover--datum-at-point)))
336336
(phpstan-hover--show (phpstan-hover--format-message datum))
337337
(setq phpstan-hover--last-shown nil)
338338
(phpstan-hover--hide)))

phpstan.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ it returns the value of `SOURCE' as it is."
480480
(defun phpstan-find-baseline-file ()
481481
"Find PHPStan baseline file of current project."
482482
(interactive)
483-
(if-let ((path (locate-dominating-file default-directory phpstan-baseline-file)))
483+
(if-let* ((path (locate-dominating-file default-directory phpstan-baseline-file)))
484484
(find-file (expand-file-name phpstan-baseline-file path))
485485
(user-error "Baseline file not found. Try running M-x phpstan-generate-baseline")))
486486

0 commit comments

Comments
 (0)