diff --git a/php-face.el b/php-face.el index b5b401da..4fc9542b 100644 --- a/php-face.el +++ b/php-face.el @@ -201,6 +201,11 @@ :group 'php-faces :tag "PHPDoc Class Name") +(defface php-class-declaration '((t (:inherit php-keyword))) + "Face used to class declarations." + :group 'php-faces + :tag "PHP Class Declaration") + (define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0") (provide 'php-face) diff --git a/php-mode.el b/php-mode.el index 3c9d8355..9a90373b 100644 --- a/php-mode.el +++ b/php-mode.el @@ -1533,6 +1533,8 @@ a completion list." 1 'php-class) ;; Support the ::class constant in PHP5.6 ("\\sw+\\(::\\)\\(class\\)\\b" (1 'php-paamayim-nekudotayim) (2 'php-magical-constant)) + ;; Class declaration keywords (class, trait, interface) + ("\\_<\\(class\\|trait\\|interface\\)\\_>" . 'php-class-declaration) ;; Highlight static method calls as such. This is necessary for method ;; names which are identical to keywords to be highlighted correctly. diff --git a/tests/7.4/typed-property.php.faces b/tests/7.4/typed-property.php.faces index 74dc9a1c..fac03f33 100644 --- a/tests/7.4/typed-property.php.faces +++ b/tests/7.4/typed-property.php.faces @@ -1,7 +1,7 @@ ;; -*- mode: emacs-lisp -*- (("