Merge branch 'uk/userdiff-php-enum'

Update the userdiff pattern for PHP.

* uk/userdiff-php-enum:
  userdiff: support enum keyword in PHP hunk header
This commit is contained in:
Junio C Hamano 2021-09-10 11:46:27 -07:00
commit 6dbe1b4ee2
2 changed files with 5 additions and 1 deletions

4
t/t4018/php-enum Normal file
View File

@ -0,0 +1,4 @@
enum RIGHT: string
{
case Foo = 'ChangeMe';
}

View File

@ -228,7 +228,7 @@ PATTERNS("perl",
"|<<|<>|<=>|>>"),
PATTERNS("php",
"^[\t ]*(((public|protected|private|static|abstract|final)[\t ]+)*function.*)$\n"
"^[\t ]*((((final|abstract)[\t ]+)?class|interface|trait).*)$",
"^[\t ]*((((final|abstract)[\t ]+)?class|enum|interface|trait).*)$",
/* -- */
"[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"