From aff92827b54f4b7f9e339982a49bab4bdbd1fc55 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Wed, 7 Oct 2020 03:38:18 +0000 Subject: userdiff: PHP: catch "abstract" and "final" functions PHP permits functions to be defined like final public function foo() { } abstract protected function bar() { } but our hunk header pattern does not recognize these decorations. Add "final" and "abstract" to the list of function modifiers. Helped-by: Johannes Sixt Signed-off-by: Javier Spagnoletti Signed-off-by: Junio C Hamano --- t/t4018/php-abstract-method | 7 +++++++ t/t4018/php-final-method | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 t/t4018/php-abstract-method create mode 100644 t/t4018/php-final-method (limited to 't/t4018') diff --git a/t/t4018/php-abstract-method b/t/t4018/php-abstract-method new file mode 100644 index 0000000000..ce215df75a --- /dev/null +++ b/t/t4018/php-abstract-method @@ -0,0 +1,7 @@ +abstract class Klass +{ + abstract public function RIGHT(): ?string + { + return 'ChangeMe'; + } +} diff --git a/t/t4018/php-final-method b/t/t4018/php-final-method new file mode 100644 index 0000000000..537fb8ad9a --- /dev/null +++ b/t/t4018/php-final-method @@ -0,0 +1,7 @@ +class Klass +{ + final public function RIGHT(): string + { + return 'ChangeMe'; + } +} -- cgit v1.2.3