From 20ee99ff6ab8248dcbdfd15d5051b44f3d8b7a6c Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 22 Feb 2020 11:44:26 +0100 Subject: [PATCH] Update .php handling to keep " is either omitted or on a separate line. A workaround for all other cases is to add the license header manually. Can always revisit this later. --- main.go | 3 ++- testdata/expected/file.php | 4 ++-- testdata/initial/file.php | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index e753753..13a0108 100644 --- a/main.go +++ b/main.go @@ -222,7 +222,7 @@ func licenseHeader(path string, tmpl *template.Template, data *copyrightData) ([ case ".html", ".xml": lic, err = prefix(tmpl, data, "") case ".php": - lic, err = prefix(tmpl, data, "") + lic, err = prefix(tmpl, data, "", "// ", "") case ".ml", ".mli", ".mll", ".mly": lic, err = prefix(tmpl, data, "(**", " ", "*)") } @@ -242,6 +242,7 @@ var head = []string{ " - +namespace App; +phpinfo(); diff --git a/testdata/initial/file.php b/testdata/initial/file.php index 147cebc..868b97d 100644 --- a/testdata/initial/file.php +++ b/testdata/initial/file.php @@ -1 +1,3 @@ - +