branch: elpa/php-mode commit b45992a6a9d019fafe7a9dcde19401b0f20a20bf Merge: 878e31369c 6af84c2b4f Author: USAMI Kenta <tad...@pixiv.com> Commit: GitHub <nore...@github.com>
Merge pull request #800 from emacs-php/refactor/when-let Use `when-let*` instead of `let` and `when` --- lisp/php.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lisp/php.el b/lisp/php.el index c08227b1f7..2e05d2a5f9 100644 --- a/lisp/php.el +++ b/lisp/php.el @@ -664,17 +664,15 @@ Currently there are `php-mode' and `php-ts-mode'." (defun php-current-class () "Insert current class name if cursor in class context." (interactive) - (let ((matched (php-get-current-element php--re-classlike-pattern))) - (when matched - (insert (concat matched php-class-suffix-when-insert))))) + (when-let* ((matched (php-get-current-element php--re-classlike-pattern))) + (insert (concat matched php-class-suffix-when-insert)))) ;;;###autoload (defun php-current-namespace () "Insert current namespace if cursor in namespace context." (interactive) - (let ((matched (php-get-current-element php--re-namespace-pattern))) - (when matched - (insert (concat matched php-namespace-suffix-when-insert))))) + (when-let* ((matched (php-get-current-element php--re-namespace-pattern))) + (insert (concat matched php-namespace-suffix-when-insert)))) ;;;###autoload (defun php-copyit-fqsen ()