Skip to content

Commit 116926d

Browse files
committed
Add new command php-copyit-fqsen for copy(kill) FQSEN
1 parent 489dcb9 commit 116926d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

php.el

+11
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,17 @@ Look at the `php-executable' variable instead of the constant \"php\" command."
352352
(when matched
353353
(insert (concat matched php-namespace-suffix-when-insert)))))
354354

355+
;;;###autoload
356+
(defun php-copyit-fqsen ()
357+
"Copy/kill class/method FQSEN."
358+
(interactive)
359+
(let ((namespace (or (php-get-current-element php--re-namespace-pattern) ""))
360+
(class (or (php-get-current-element php--re-classlike-pattern) ""))
361+
(namedfunc (php-get-current-element php-beginning-of-defun-regexp)))
362+
(kill-new (concat (if (string= namespace "") "" namespace)
363+
(if (string= class "") "" (concat "\\" class "::"))
364+
(if (string= namedfunc "") "" (concat namedfunc "()"))))))
365+
355366
;;;###autoload
356367
(defun php-run-builtin-web-server (router-or-dir hostname port &optional document-root)
357368
"Run PHP Built-in web server.

0 commit comments

Comments
 (0)