Skip to content

Commit 67e122b

Browse files
committed
Keywords: enhancements
1 parent 90dcf54 commit 67e122b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/KeywordEnhancer.php

Lines changed: 2 additions & 1 deletion
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-Za-z][A-Za-z]+::(?:__)?[a-z][A-Za-z\d_]+\(\)(?![`\/-])/', // Class::methods()
1212
'/\b(?<!`)[A-Z][A-Za-z]+::(?:__)[a-z][A-Za-z\d_]+(?![`\/-])\b(?![)(])/', // Class::__magicMethods
1313
'/\b(?<!`)[A-Z][A-Za-z]+::[A-Z_]+\b(?![`\/(])/', // Class::CONSTANTS
1414
'/\b(?<![`\\\\])[A-Z][A-Z\\\\a-z]+::[a-z][A-Za-z_\d]+\b(?![`\/(])/', // Class::constants
@@ -21,6 +21,7 @@ class KeywordEnhancer {
2121
'/\b(?<![`>:-])__[A-Z\d_]+(?![`])/i', // __PROPERTY__
2222
'/(?<=\s)(?<![`>-])\\\\[A-Z][a-z]+\\\\[A-Z][A-Za-z]+(?![`])\b/', // Stricter, class name like \Dom\HTMLDocument
2323
'/\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
24+
'/\b(?<!`)(?:(SOAP|SO|TCP|SOCK|FILTER|XML|FTP|CURL|GREP))_[A-Z_]+\b(?![`\/(])/', // CONSTANTS (with fixed prefixes)
2425
];
2526

2627
public static function enhance(string $inputText): string {

0 commit comments

Comments
 (0)