Skip to content

Commit 093ee5d

Browse files
committed
Keywords: improve patterns
1 parent 5d43694 commit 093ee5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/KeywordEnhancer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class KeywordEnhancer {
88
'/\b(?<!`)(?:zend|php|_php)_[a-z_*]+\b(?![`.(=])\*?/i', // zend_foo_bar
99
'/\b(?<![`\/])[a-z][a-z\d_-]+(.stubs?)?\.(phpt?|c|h)(?![`.?])/', // run-tests.php / foo.stub.php foo.stubs.php / test-foo-bar.phpt,
1010
'/\b(?<!`)ext\/[a-z_]+\b(?![`\/])/', // ext-names
11-
'/\b(?<!`)[A-Z][A-Za-z]+::[a-z][A-Za-z\d_]+\(\)(?![`\/-])/', // Class::methods()
11+
'/\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
1313
'/\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 ()
@@ -17,7 +17,7 @@ class KeywordEnhancer {
1717
'/\b(?<!`)(xleak|xfail|skipif)\b(?![`\/])/i', // xleak
1818
'/(?<![`>()-])--[a-z][a-z-]+(?![`])/i', // --flags, --flags-and-more
1919
'/(?<![`>()-])\bext\/[a-z_\d\/-]+\.phpt\b(?![`])/i', // ext/test/test/test.phpt
20-
'/\b(?<![`>-])__[A-Z\d_]+(?![`])/i', // __PROPERTY__
20+
'/\b(?<![`>:-])__[A-Z\d_]+(?![`])/i', // __PROPERTY__
2121
'/(?<=\s)(?<![`>-])\\\\[A-Z][a-z]+\\\\[A-Z][A-Za-z]+(?![`])\b/', // Stricter, class name like \Dom\HTMLDocument
2222
'/\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
2323
];

0 commit comments

Comments
 (0)