diff --git a/php-mode-test.el b/php-mode-test.el index 5d37d8c5..57ebd89c 100644 --- a/php-mode-test.el +++ b/php-mode-test.el @@ -928,6 +928,11 @@ style from Drupal." "Test highlighting of type hints and return types." (with-php-mode-test ("type-hints.php" :faces t))) +(ert-deftest php-mode-test-static-method-calls () + "Test highlighting of static method calls which are named the same +as a keyword." + (with-php-mode-test ("static-method-calls.php" :faces t))) + (ert-deftest php-mode-debug-test () "Test running php-mode-debug and php-mode-debug--buffer." (with-temp-buffer diff --git a/php-mode.el b/php-mode.el index 8e72fe30..cdc668fb 100644 --- a/php-mode.el +++ b/php-mode.el @@ -16,7 +16,7 @@ (defconst php-mode-version-number "1.21.0" "PHP Mode version number.") -(defconst php-mode-modified "2019-02-28" +(defconst php-mode-modified "2019-03-04" "PHP Mode build date.") ;; This file is free software; you can redistribute it and/or @@ -1688,6 +1688,10 @@ a completion list." ;; Support the ::class constant in PHP5.6 ("\\sw+\\(::\\)\\(class\\)\\b" (1 'php-paamayim-nekudotayim) (2 'php-constant)) + ;; Highlight static method calls as such. This is necessary for method + ;; names which are identical to keywords to be highlighted correctly. + ("\\sw+::\\(\\sw+\\)(" 1 'php-static-method-call) + ;; While c-opt-cpp-* highlights the