summaryrefslogtreecommitdiff
path: root/t/t4018
diff options
context:
space:
mode:
authorJavier Spagnoletti <phansys@gmail.com>2020-10-07 03:38:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-10-07 15:45:43 (GMT)
commitaff92827b54f4b7f9e339982a49bab4bdbd1fc55 (patch)
tree1a777dafd9e8822a4745b04547606569ef6226d8 /t/t4018
parentd98273ba77e1ab9ec755576bc86c716a97bf59d7 (diff)
downloadgit-aff92827b54f4b7f9e339982a49bab4bdbd1fc55.zip
git-aff92827b54f4b7f9e339982a49bab4bdbd1fc55.tar.gz
git-aff92827b54f4b7f9e339982a49bab4bdbd1fc55.tar.bz2
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 <j6t@kdbg.org> Signed-off-by: Javier Spagnoletti <phansys@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4018')
-rw-r--r--t/t4018/php-abstract-method7
-rw-r--r--t/t4018/php-final-method7
2 files changed, 14 insertions, 0 deletions
diff --git a/t/t4018/php-abstract-method b/t/t4018/php-abstract-method
new file mode 100644
index 0000000..ce215df
--- /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 0000000..537fb8a
--- /dev/null
+++ b/t/t4018/php-final-method
@@ -0,0 +1,7 @@
+class Klass
+{
+ final public function RIGHT(): string
+ {
+ return 'ChangeMe';
+ }
+}