From eb40a8924fe1f16d5954be9d1be43377571b6f24 Mon Sep 17 00:00:00 2001
From: Charlie McMackin <charliemac@gmail.com>
Date: Sun, 29 Sep 2019 11:17:11 -0500
Subject: [PATCH 1/2] Use abbreviate-file-name instead of manual regex
 replacement

---
 php.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/php.el b/php.el
index c7e836a7..64286da7 100644
--- a/php.el
+++ b/php.el
@@ -393,9 +393,8 @@ When `DOCUMENT-ROOT' is NIL, the document root is obtained from `ROUTER-OR-DIR'.
                (if (file-directory-p router-or-dir)
                    router-or-dir
                  (directory-file-name router-or-dir))))
-         (pattern (rx-form `(: bos ,(getenv "HOME"))))
-         (short-dirname (replace-regexp-in-string pattern "~" default-directory))
-         (short-filename (replace-regexp-in-string pattern "~" router-or-dir))
+         (short-dirname (abbreviate-file-name default-directory))
+         (short-filename (abbreviate-file-name router-or-dir))
          (buf-name (format "php -S %s:%s -t %s %s"
                            hostname
                            port

From 75d3ee1ead7557175e6aeb2ad8efdd73ee3c9332 Mon Sep 17 00:00:00 2001
From: Charlie McMackin <charliemac@gmail.com>
Date: Sun, 29 Sep 2019 11:52:54 -0500
Subject: [PATCH 2/2] Replace rx-form with rx-to-string

`rx-form` is being removed in an upcoming version of Emacs and its rewrite of
`rx`. Replacing it with `rx-to-string` is backwards and future compatible.
---
 php.el | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/php.el b/php.el
index 64286da7..ea36fc3d 100644
--- a/php.el
+++ b/php.el
@@ -177,24 +177,24 @@ keywords that can appear in method signatures, e.g. 'final' and
 which will be the name of the method."
     (when (stringp visibility)
       (setq visibility (list visibility)))
-    (rx-form `(: line-start
-                 (* (syntax whitespace))
-                 ,@(if visibility
-                      `((* (or "abstract" "final" "static")
-                           (+ (syntax whitespace)))
-                        (or ,@visibility)
-                        (+ (syntax whitespace))
-                        (* (or "abstract" "final" "static")
-                           (+ (syntax whitespace))))
-                     '((* (* (or "abstract" "final" "static"
-                                 "private" "protected" "public")
-                             (+ (syntax whitespace))))))
-                 "function"
-                 (+ (syntax whitespace))
-                 (? "&" (* (syntax whitespace)))
-                 (group (+ (or (syntax word) (syntax symbol))))
-                 (* (syntax whitespace))
-                 "(")))
+    (rx-to-string `(: line-start
+                      (* (syntax whitespace))
+                      ,@(if visibility
+                            `((* (or "abstract" "final" "static")
+                                 (+ (syntax whitespace)))
+                              (or ,@visibility)
+                              (+ (syntax whitespace))
+                              (* (or "abstract" "final" "static")
+                                 (+ (syntax whitespace))))
+                          '((* (* (or "abstract" "final" "static"
+                                      "private" "protected" "public")
+                                  (+ (syntax whitespace))))))
+                      "function"
+                      (+ (syntax whitespace))
+                      (? "&" (* (syntax whitespace)))
+                      (group (+ (or (syntax word) (syntax symbol))))
+                      (* (syntax whitespace))
+                      "(")))
 
   (defun php-create-regexp-for-classlike (type)
     "Accepts a `TYPE' of a 'classlike' object as a string, such as