From 1ab631647e3addd247c5482e8a3d4c9df7978c62 Mon Sep 17 00:00:00 2001 From: Kana Natsuno Date: Tue, 3 Jul 2018 22:15:40 +0900 Subject: userdiff: support new keywords in PHP hunk header Recent version of PHP supports interface, trait, abstract class and final class. This patch fixes the PHP hunk header regexp to support all of these keywords. Signed-off-by: Kana Natsuno Signed-off-by: Junio C Hamano --- t/t4018/php-abstract-class | 4 ++++ t/t4018/php-final-class | 4 ++++ t/t4018/php-interface | 4 ++++ t/t4018/php-trait | 7 +++++++ 4 files changed, 19 insertions(+) create mode 100644 t/t4018/php-abstract-class create mode 100644 t/t4018/php-final-class create mode 100644 t/t4018/php-interface create mode 100644 t/t4018/php-trait (limited to 't/t4018') diff --git a/t/t4018/php-abstract-class b/t/t4018/php-abstract-class new file mode 100644 index 0000000000..5213e12494 --- /dev/null +++ b/t/t4018/php-abstract-class @@ -0,0 +1,4 @@ +abstract class RIGHT +{ + const FOO = 'ChangeMe'; +} diff --git a/t/t4018/php-final-class b/t/t4018/php-final-class new file mode 100644 index 0000000000..69f5710552 --- /dev/null +++ b/t/t4018/php-final-class @@ -0,0 +1,4 @@ +final class RIGHT +{ + const FOO = 'ChangeMe'; +} diff --git a/t/t4018/php-interface b/t/t4018/php-interface new file mode 100644 index 0000000000..86b49ad5d9 --- /dev/null +++ b/t/t4018/php-interface @@ -0,0 +1,4 @@ +interface RIGHT +{ + public function foo($ChangeMe); +} diff --git a/t/t4018/php-trait b/t/t4018/php-trait new file mode 100644 index 0000000000..65b8c82a61 --- /dev/null +++ b/t/t4018/php-trait @@ -0,0 +1,7 @@ +trait RIGHT +{ + public function foo($ChangeMe) + { + return 'foo'; + } +} -- cgit v1.2.3