Skip to content

Commit bf437c0

Browse files
committed
Fix highlighting of array keyword for parameters passed by reference
1 parent 68fcbfd commit bf437c0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

php-mode-test.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,8 @@ style from Drupal."
757757
(get-text-property (point) 'face)))))
758758
;; Type situations
759759
(let ((variables '("(array)"
760-
"array $test"
760+
"array $byValue"
761+
"array &$byReference"
761762
": array")))
762763
(dolist (variable variables)
763764
(search-forward variable)

php-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
(defconst php-mode-version-number "1.18.4"
1616
"PHP Mode version number.")
1717

18-
(defconst php-mode-modified "2017-12-03"
18+
(defconst php-mode-modified "2018-01-25"
1919
"PHP Mode build date.")
2020

2121
;; This file is free software; you can redistribute it and/or
@@ -1553,7 +1553,7 @@ a completion list."
15531553
;; - when used as a type hint
15541554
;; - when used as a return type
15551555
("(\\(array\\))" 1 font-lock-type-face)
1556-
("\\b\\(array\\)\\s-+\\$" 1 font-lock-type-face)
1556+
("\\b\\(array\\)\\s-+&?\\$" 1 font-lock-type-face)
15571557
(")\\s-*:\\s-*\\??\\(array\\)\\b" 1 font-lock-type-face)
15581558

15591559
;; Support the ::class constant in PHP5.6

tests/arrays.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
// - return type, should look like `: int`
1313
$test = (array)$test;
1414

15-
$test = function(array $test): array {
15+
$test = function(array $byValue, array &$byReference): array {
1616
};

0 commit comments

Comments
 (0)