Skip to content

Commit 5d43694

Browse files
committed
Keywords: Add support for FQFN class names with a namespace
1 parent e525518 commit 5d43694

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/KeywordEnhancer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class KeywordEnhancer {
1818
'/(?<![`>()-])--[a-z][a-z-]+(?![`])/i', // --flags, --flags-and-more
1919
'/(?<![`>()-])\bext\/[a-z_\d\/-]+\.phpt\b(?![`])/i', // ext/test/test/test.phpt
2020
'/\b(?<![`>-])__[A-Z\d_]+(?![`])/i', // __PROPERTY__
21+
'/(?<=\s)(?<![`>-])\\\\[A-Z][a-z]+\\\\[A-Z][A-Za-z]+(?![`])\b/', // Stricter, class name like \Dom\HTMLDocument
2122
'/\b(?<![`>()-])(?:(main|ext|Zend|tests|win32|scripts|sapi|pear|docs|build)\/(?:[a-z\/_]+))(?:\.(c|php|phpt|yml|yaml|cpp|m4|txt|w32|h))(?::\d+)?(?![`])/i', // files in php-src
2223
];
2324

0 commit comments

Comments
 (0)