From def275ab3cfbaabd940dec5280a1daa185deb424 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Wed, 3 Apr 2019 16:25:00 -0500 Subject: [PATCH] Remove closing tags from pure PHP files --- README.md | 2 ++ lib/Collection.php | 1 - lib/Constants.php | 1 - lib/Contributor.php | 1 - lib/Core.php | 1 - lib/CoreFunctions.php | 1 - lib/Ebook.php | 1 - lib/EbookParsingException.php | 1 - lib/EbookSource.php | 1 - lib/Formatter.php | 1 - lib/GitCommit.php | 1 - lib/HttpInput.php | 1 - lib/InvalidAuthorException.php | 1 - lib/InvalidEbookException.php | 1 - lib/Library.php | 1 - lib/Logger.php | 1 - lib/NoopException.php | 1 - lib/SeeOtherEbookException.php | 1 - lib/Tag.php | 1 - lib/Template.php | 1 - lib/WebhookException.php | 1 - 21 files changed, 2 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e3b187ec..717095b4 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,8 @@ Before submitting design contributions, please discuss them with the Standard Eb preg_replace('||ius', '', $text); ```` +- Omit closing PHP tags in files that are pure PHP. + - Language constructs that can optionally have curly braces (like `if`) should always have curly braces. Good: diff --git a/lib/Collection.php b/lib/Collection.php index 9d684559..fce46969 100644 --- a/lib/Collection.php +++ b/lib/Collection.php @@ -8,4 +8,3 @@ class Collection{ $this->Url = '/collections/' . strtolower(str_replace(' ', '-', Formatter::ToPlainText(Formatter::RemoveDiacritics($this->Name)))) . '/'; } } -?> diff --git a/lib/Constants.php b/lib/Constants.php index 6df0ebf9..2ee2efd3 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -33,4 +33,3 @@ const REPOS_PATH = SITE_ROOT . '/ebooks'; const GITHUB_SECRET_FILE_PATH = SITE_ROOT . '/config/secrets/se-vcs-bot@github.com'; // Set in the GitHub organization global webhook settings. const GITHUB_WEBHOOK_LOG_FILE_PATH = '/var/log/local/webhooks-github.log'; // Must be writable by `www-data` Unix user. const GITHUB_IGNORED_REPOS = ['tools', 'manual', 'web']; // If we get GitHub push requests featuring these repos, silently ignore instead of returning an error. -?> diff --git a/lib/Contributor.php b/lib/Contributor.php index e08ac21b..7f182b1d 100644 --- a/lib/Contributor.php +++ b/lib/Contributor.php @@ -16,4 +16,3 @@ class Contributor{ $this->MarcRole = $marcRole; } } -?> diff --git a/lib/Core.php b/lib/Core.php index 157d5569..6ba2777c 100644 --- a/lib/Core.php +++ b/lib/Core.php @@ -24,4 +24,3 @@ set_exception_handler(function($ex){ throw $ex; // Send the exception back to PHP for its usual logging routine. }); -?> diff --git a/lib/CoreFunctions.php b/lib/CoreFunctions.php index 41ea9c82..b1695e8a 100644 --- a/lib/CoreFunctions.php +++ b/lib/CoreFunctions.php @@ -23,4 +23,3 @@ function vds($var){ ob_end_clean(); return $str; } -?> diff --git a/lib/Ebook.php b/lib/Ebook.php index 40026fed..3b9f56b1 100644 --- a/lib/Ebook.php +++ b/lib/Ebook.php @@ -536,4 +536,3 @@ class Ebook{ return false; } } -?> diff --git a/lib/EbookParsingException.php b/lib/EbookParsingException.php index d2f8c40a..2a7d0aec 100644 --- a/lib/EbookParsingException.php +++ b/lib/EbookParsingException.php @@ -1,4 +1,3 @@ diff --git a/lib/EbookSource.php b/lib/EbookSource.php index 1d656856..98aeb091 100644 --- a/lib/EbookSource.php +++ b/lib/EbookSource.php @@ -8,4 +8,3 @@ class EbookSource{ $this->Url = $url; } } -?> diff --git a/lib/Formatter.php b/lib/Formatter.php index 4b97cf0b..42121119 100644 --- a/lib/Formatter.php +++ b/lib/Formatter.php @@ -36,4 +36,3 @@ class Formatter{ return htmlspecialchars(trim($text), ENT_QUOTES, 'UTF-8'); } } -?> diff --git a/lib/GitCommit.php b/lib/GitCommit.php index ea92cd2a..a0dc9451 100644 --- a/lib/GitCommit.php +++ b/lib/GitCommit.php @@ -8,4 +8,3 @@ class GitCommit{ $this->Message = $message; } } -?> diff --git a/lib/HttpInput.php b/lib/HttpInput.php index 57471191..f1c45a4a 100644 --- a/lib/HttpInput.php +++ b/lib/HttpInput.php @@ -79,4 +79,3 @@ class HttpInput{ return $default; } } -?> diff --git a/lib/InvalidAuthorException.php b/lib/InvalidAuthorException.php index 1539eb13..06cb37b9 100644 --- a/lib/InvalidAuthorException.php +++ b/lib/InvalidAuthorException.php @@ -1,4 +1,3 @@ diff --git a/lib/InvalidEbookException.php b/lib/InvalidEbookException.php index 797829ae..68c403c1 100644 --- a/lib/InvalidEbookException.php +++ b/lib/InvalidEbookException.php @@ -1,4 +1,3 @@ diff --git a/lib/Library.php b/lib/Library.php index dcc0c9e1..c1a5d745 100644 --- a/lib/Library.php +++ b/lib/Library.php @@ -191,4 +191,3 @@ class Library{ return $matches; } } -?> diff --git a/lib/Logger.php b/lib/Logger.php index 04d6a937..15c55730 100644 --- a/lib/Logger.php +++ b/lib/Logger.php @@ -22,4 +22,3 @@ class Logger{ error_log($text); } } -?> diff --git a/lib/NoopException.php b/lib/NoopException.php index f3edcc8d..b439b55d 100644 --- a/lib/NoopException.php +++ b/lib/NoopException.php @@ -1,4 +1,3 @@ diff --git a/lib/SeeOtherEbookException.php b/lib/SeeOtherEbookException.php index b0c47247..def2120c 100644 --- a/lib/SeeOtherEbookException.php +++ b/lib/SeeOtherEbookException.php @@ -7,4 +7,3 @@ class SeeOtherEbookException extends \Exception{ parent::__construct('This ebook is at a different URL: ' . $url); } } -?> diff --git a/lib/Tag.php b/lib/Tag.php index 5274a1fb..da77e360 100644 --- a/lib/Tag.php +++ b/lib/Tag.php @@ -8,4 +8,3 @@ class Tag{ $this->Url = '/tags/' . strtolower(str_replace(' ', '-', Formatter::ToPlainText($this->Name))) . '/'; } } -?> diff --git a/lib/Template.php b/lib/Template.php index 19216c36..17c16e69 100644 --- a/lib/Template.php +++ b/lib/Template.php @@ -37,4 +37,3 @@ class Template{ } } } -?> diff --git a/lib/WebhookException.php b/lib/WebhookException.php index 3f02042c..e76d62fd 100644 --- a/lib/WebhookException.php +++ b/lib/WebhookException.php @@ -7,4 +7,3 @@ class WebhookException extends \Exception{ parent::__construct($message); } } -?>