Remove closing tags from pure PHP files

This commit is contained in:
Alex Cabal 2019-04-03 16:25:00 -05:00
parent 0cd89eb10c
commit def275ab3c
21 changed files with 2 additions and 20 deletions

View file

@ -109,6 +109,8 @@ Before submitting design contributions, please discuss them with the Standard Eb
preg_replace('|</foo>|ius', '</bar>', $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:

View file

@ -8,4 +8,3 @@ class Collection{
$this->Url = '/collections/' . strtolower(str_replace(' ', '-', Formatter::ToPlainText(Formatter::RemoveDiacritics($this->Name)))) . '/';
}
}
?>

View file

@ -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.
?>

View file

@ -16,4 +16,3 @@ class Contributor{
$this->MarcRole = $marcRole;
}
}
?>

View file

@ -24,4 +24,3 @@ set_exception_handler(function($ex){
throw $ex; // Send the exception back to PHP for its usual logging routine.
});
?>

View file

@ -23,4 +23,3 @@ function vds($var){
ob_end_clean();
return $str;
}
?>

View file

@ -536,4 +536,3 @@ class Ebook{
return false;
}
}
?>

View file

@ -1,4 +1,3 @@
<?
class EbookParsingException extends \Exception{
}
?>

View file

@ -8,4 +8,3 @@ class EbookSource{
$this->Url = $url;
}
}
?>

View file

@ -36,4 +36,3 @@ class Formatter{
return htmlspecialchars(trim($text), ENT_QUOTES, 'UTF-8');
}
}
?>

View file

@ -8,4 +8,3 @@ class GitCommit{
$this->Message = $message;
}
}
?>

View file

@ -79,4 +79,3 @@ class HttpInput{
return $default;
}
}
?>

View file

@ -1,4 +1,3 @@
<?
class InvalidAuthorException extends \Exception{
}
?>

View file

@ -1,4 +1,3 @@
<?
class InvalidEbookException extends \Exception{
}
?>

View file

@ -191,4 +191,3 @@ class Library{
return $matches;
}
}
?>

View file

@ -22,4 +22,3 @@ class Logger{
error_log($text);
}
}
?>

View file

@ -1,4 +1,3 @@
<?
class NoopException extends \Exception{
}
?>

View file

@ -7,4 +7,3 @@ class SeeOtherEbookException extends \Exception{
parent::__construct('This ebook is at a different URL: ' . $url);
}
}
?>

View file

@ -8,4 +8,3 @@ class Tag{
$this->Url = '/tags/' . strtolower(str_replace(' ', '-', Formatter::ToPlainText($this->Name))) . '/';
}
}
?>

View file

@ -37,4 +37,3 @@ class Template{
}
}
}
?>

View file

@ -7,4 +7,3 @@ class WebhookException extends \Exception{
parent::__construct($message);
}
}
?>