Skip to content

Commit d3f0938

Browse files
committed
Merge branch 'kn/userdiff-php'
The userdiff pattern for .php has been updated. * kn/userdiff-php: userdiff: support new keywords in PHP hunk header t4018: add missing test cases for PHP
2 parents 49b46fd + 1ab6316 commit d3f0938

File tree

8 files changed

+35
-1
lines changed

8 files changed

+35
-1
lines changed

t/t4018/php-abstract-class

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
abstract class RIGHT
2+
{
3+
const FOO = 'ChangeMe';
4+
}

t/t4018/php-class

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class RIGHT
2+
{
3+
const FOO = 'ChangeMe';
4+
}

t/t4018/php-final-class

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
final class RIGHT
2+
{
3+
const FOO = 'ChangeMe';
4+
}

t/t4018/php-function

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function RIGHT()
2+
{
3+
return 'ChangeMe';
4+
}

t/t4018/php-interface

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface RIGHT
2+
{
3+
public function foo($ChangeMe);
4+
}

t/t4018/php-method

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Klass
2+
{
3+
public static function RIGHT()
4+
{
5+
return 'ChangeMe';
6+
}
7+
}

t/t4018/php-trait

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
trait RIGHT
2+
{
3+
public function foo($ChangeMe)
4+
{
5+
return 'foo';
6+
}
7+
}

userdiff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ PATTERNS("perl",
114114
"|<<|<>|<=>|>>"),
115115
PATTERNS("php",
116116
"^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
117-
"^[\t ]*(class.*)$",
117+
"^[\t ]*((((final|abstract)[\t ]+)?class|interface|trait).*)$",
118118
/* -- */
119119
"[a-zA-Z_][a-zA-Z0-9_]*"
120120
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"

0 commit comments

Comments
 (0)