Skip to content

Commit

Permalink
Generators HTML/Markdown: remove some duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Nov 4, 2024
1 parent 0d6171f commit a915894
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
7 changes: 1 addition & 6 deletions src/Generators/HTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,7 @@ public function generate()
}

ob_start();
foreach ($this->docFiles as $file) {
$doc = new DOMDocument();
$doc->load($file);
$documentation = $doc->getElementsByTagName('documentation')->item(0);
$this->processSniff($documentation);
}
parent::generate();

$content = ob_get_contents();
ob_end_clean();
Expand Down
8 changes: 1 addition & 7 deletions src/Generators/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace PHP_CodeSniffer\Generators;

use DOMDocument;
use DOMNode;
use PHP_CodeSniffer\Config;

Expand All @@ -30,12 +29,7 @@ public function generate()
}

ob_start();
foreach ($this->docFiles as $file) {
$doc = new DOMDocument();
$doc->load($file);
$documentation = $doc->getElementsByTagName('documentation')->item(0);
$this->processSniff($documentation);
}
parent::generate();

$content = ob_get_contents();
ob_end_clean();
Expand Down

0 comments on commit a915894

Please sign in to comment.