Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lisp/php-face.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@
:group 'php-faces
:tag "PHP Function Name")

(defface php-function-call '((t ()))
;; `font-lock-function-call-face' was added in Emacs 29.1
(defface php-function-call (eval-when-compile
(if (get 'font-lock-function-call-face 'face-defface-spec)
'((t (:inherit font-lock-function-call-face)))
'((t ()))))
"PHP Mode face used to highlight function names in calles."
:group 'php-faces
:tag "PHP Function Call")
Expand Down
6 changes: 6 additions & 0 deletions tests/php-mode-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,12 @@ Meant for `php-mode-test-issue-503'."
(with-php-mode-test ("indent/issue-702.php" :indent t :magic t))
(with-php-mode-test ("indent/issue-726.php" :indent t :magic t)))

(ert-deftest php-mode-test-issue-782 ()
"Test that function calls are fontified."
(if (version< emacs-version "29.1")
(should (eq (face-attribute 'php-function-call :inherit) nil))
(should (eq (face-attribute 'php-function-call :inherit) 'font-lock-function-call-face))))

(ert-deftest php-mode-test-php74 ()
"Test highlighting language constructs added in PHP 7.4."
(with-php-mode-test ("7.4/arrow-function.php" :faces t))
Expand Down