Skip to content

Commit 2c7f3aa

Browse files
zonuexegitster
authored andcommitted
userdiff: support enum keyword in PHP hunk header
"enum" keyword will be introduced in PHP 8.1. https://wiki.php.net/rfc/enumerations Signed-off-by: USAMI Kenta <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 225bc32 commit 2c7f3aa

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

t/t4018/php-enum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
enum RIGHT: string
2+
{
3+
case Foo = 'ChangeMe';
4+
}

userdiff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ PATTERNS("perl",
214214
"|<<|<>|<=>|>>"),
215215
PATTERNS("php",
216216
"^[\t ]*(((public|protected|private|static|abstract|final)[\t ]+)*function.*)$\n"
217-
"^[\t ]*((((final|abstract)[\t ]+)?class|interface|trait).*)$",
217+
"^[\t ]*((((final|abstract)[\t ]+)?class|enum|interface|trait).*)$",
218218
/* -- */
219219
"[a-zA-Z_][a-zA-Z0-9_]*"
220220
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"

0 commit comments

Comments
 (0)