{"thread":{"id":"23882","subject":"[PATCH] diff: Support visibility modifiers in the PHP hunk header regexp","startedAt":"2010-05-23T18:05:40Z","lastAt":"2010-05-23T18:05:40Z","messageCount":1,"participants":["Björn Steinbrink"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"142153","messageId":"20100523180540.GA29729@atjola.homenet","threadId":"23882","inReplyTo":null,"subject":"[PATCH] diff: Support visibility modifiers in the PHP hunk header regexp","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2010-05-23T18:05:40Z","receivedAt":"2010-05-23T18:05:40Z","isPatch":true,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"Starting with PHP5, class methods can have a visibility modifier, which\ncaused the methods not to be matched by the existing regexp, so extend\nthe regexp to match those modifiers. And while we're at it, allow the\n\"static\" modifier as well.\n\nSince the \"static\" modifier can appear either before or after the\nvisibility modifier, let's just allow any number of modifiers to appear\nin any order, as that simplifies the regexp and shouldn't cause any\nfalse positives.\n\nSigned-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>\n---\n userdiff.c |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/userdiff.c b/userdiff.c\nindex 67003fb..c49cc1b 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -45,7 +45,9 @@ PATTERNS(\"pascal\",\n \t \"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+\"\n \t \"|<>|<=|>=|:=|\\\\.\\\\.\"\n \t \"|[^[:space:]]|[\\x80-\\xff]+\"),\n-PATTERNS(\"php\", \"^[\\t ]*((function|class).*)\",\n+PATTERNS(\"php\",\n+\t \"^[\\t ]*(((public|protected|private|static)[\\t ]+)*function.*)$\\n\"\n+\t \"^[\\t ]*(class.*)$\",\n \t /* -- */\n \t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n \t \"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+\"\n-- \n1.7.1.227.g12cb1\n"}]}