branch: elpa/php-mode commit 6af84c2b4f558eec14ae74dbe6fb979da24d5b86 Author: USAMI Kenta <tad...@zonu.me> Commit: USAMI Kenta <tad...@zonu.me>
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 ()