Message ID | pull.1082.git.git.1630389685997.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 2c7f3aacd31b564beca3a3d93a98f4efded6af58 |
Headers | show |
Series | userdiff: support enum keyword in PHP hunk header | expand |
"USAMI Kenta via GitGitGadget" <gitgitgadget@gmail.com> writes: > From: USAMI Kenta <tadsan@zonu.me> > > "enum" keyword will be introduced in PHP 8.1. > https://wiki.php.net/rfc/enumerations > > Signed-off-by: USAMI Kenta <tadsan@zonu.me> > --- > userdiff: support enum keyword in PHP hunk header > > "enum" keyword will be introduced in PHP 8.1. > https://wiki.php.net/rfc/enumerations I no longer speak PHP, but this looks sensible to me. Thanks, will queue.
diff --git a/t/t4018/php-enum b/t/t4018/php-enum new file mode 100644 index 00000000000..91a69c1a2bc --- /dev/null +++ b/t/t4018/php-enum @@ -0,0 +1,4 @@ +enum RIGHT: string +{ + case Foo = 'ChangeMe'; +} diff --git a/userdiff.c b/userdiff.c index d9b2ba752f0..d9ec484d535 100644 --- a/userdiff.c +++ b/userdiff.c @@ -214,7 +214,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]+"