diff --git a/src/Generators/HTML.php b/src/Generators/HTML.php
index a1093a1660..51721afa4b 100644
--- a/src/Generators/HTML.php
+++ b/src/Generators/HTML.php
@@ -149,15 +149,20 @@ protected function printHeader()
protected function getFormattedHeader()
{
$standard = $this->ruleset->name;
- $output = ''.PHP_EOL;
- $output .= '
'.PHP_EOL;
- $output .= " $standard Coding Standards".PHP_EOL;
- $output .= ' '.str_replace("\n", PHP_EOL, self::STYLESHEET).PHP_EOL;
- $output .= ' '.PHP_EOL;
- $output .= ' '.PHP_EOL;
- $output .= " $standard Coding Standards
".PHP_EOL;
-
- return $output;
+ $output = sprintf(
+ '
+
+ %1$s Coding Standards
+ %2$s
+
+
+ %1$s Coding Standards
',
+ $standard,
+ self::STYLESHEET
+ );
+
+ // Use the correct line endings based on the OS.
+ return str_replace("\n", PHP_EOL, $output).PHP_EOL;
}//end getFormattedHeader()
@@ -197,12 +202,14 @@ protected function getFormattedToc()
$output = ' Table of Contents
'.PHP_EOL;
$output .= ' '.PHP_EOL;
+ $listItemTemplate = ' - %s
'.PHP_EOL;
+
foreach ($this->docFiles as $file) {
$doc = new DOMDocument();
$doc->load($file);
$documentation = $doc->getElementsByTagName('documentation')->item(0);
$title = $this->getTitle($documentation);
- $output .= ' - '.$title.'
'.PHP_EOL;
+ $output .= sprintf($listItemTemplate, str_replace(' ', '-', $title), $title);
}
$output .= '
'.PHP_EOL;
@@ -240,16 +247,17 @@ protected function getFormattedFooter()
// Turn off errors so we don't get timezone warnings if people
// don't have their timezone set.
$errorLevel = error_reporting(0);
- $output = ' '.PHP_EOL;
+ $output = sprintf(
+ '
+
+',
+ date('r'),
+ Config::VERSION
+ );
error_reporting($errorLevel);
- $output .= ' '.PHP_EOL;
- $output .= ''.PHP_EOL;
-
- return $output;
+ // Use the correct line endings based on the OS.
+ return str_replace("\n", PHP_EOL, $output).PHP_EOL;
}//end getFormattedFooter()
diff --git a/tests/Core/Generators/Fixtures/HTMLDouble.php b/tests/Core/Generators/Fixtures/HTMLDouble.php
index e3d797c118..8b737fb7c4 100644
--- a/tests/Core/Generators/Fixtures/HTMLDouble.php
+++ b/tests/Core/Generators/Fixtures/HTMLDouble.php
@@ -20,14 +20,12 @@ class HTMLDouble extends HTML
*/
protected function getFormattedFooter()
{
- $output = ' '.PHP_EOL;
- $output .= '