Skip to content

Commit a48224d

Browse files
committed
Keywords: fix class constant detection to catch namespaces
1 parent 691062e commit a48224d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/KeywordEnhancer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class KeywordEnhancer {
1010
'/\b(?<!`)ext\/[a-z_]+\b(?![`\/])/', // ext-names
1111
'/\b(?<!`)[A-Z][A-Za-z]+::[a-z][A-Za-z\d_]+\(\)(?![`\/-])/', // Class::methods()
1212
'/\b(?<!`)[A-Z][A-Za-z]+::[A-Z_]+\b(?![`\/(])/', // Class::CONSTANTS
13-
'/\b(?<!`)[A-Z][A-Za-z]+::[a-z][A-Za-z_\d]+\b(?![`\/(])/', // Class::constants
13+
'/\b(?<![`\\\\])[A-Z][A-Z\\\\a-z]+::[a-z][A-Za-z_\d]+\b(?![`\/(])/', // Class::constants
1414
'/\b(?<!`-)[a-z]+_[a-z]+(?:_[a-z_]+)?\(\)(?![`\/])/', // Functions with underscores and ()
1515
'/\b(?<![`>])[a-z_][a-z][a-z\d_]+\(\)(?![`.>\/-])/', // Functions with underscores and ()
1616
'/\b(?<!`)(?:ldap|ftp|array|mb|stream|open|hash|xml|proc)_[a-z_]+\d?\b(?![`\/])/', // Functions with underscores and no ()

0 commit comments

Comments
 (0)