Skip to content

Commit e58fc99

Browse files
committed
Generators HTML/Markdown: remove some duplicate code
1 parent 45f8af7 commit e58fc99

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/Generators/HTML.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,7 @@ public function generate()
108108
}
109109

110110
ob_start();
111-
foreach ($this->docFiles as $file) {
112-
$doc = new DOMDocument();
113-
$doc->load($file);
114-
$documentation = $doc->getElementsByTagName('documentation')->item(0);
115-
$this->processSniff($documentation);
116-
}
111+
parent::generate();
117112

118113
$content = ob_get_contents();
119114
ob_end_clean();

src/Generators/Markdown.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace PHP_CodeSniffer\Generators;
1313

14-
use DOMDocument;
1514
use DOMNode;
1615
use PHP_CodeSniffer\Config;
1716

@@ -32,12 +31,7 @@ public function generate()
3231
}
3332

3433
ob_start();
35-
foreach ($this->docFiles as $file) {
36-
$doc = new DOMDocument();
37-
$doc->load($file);
38-
$documentation = $doc->getElementsByTagName('documentation')->item(0);
39-
$this->processSniff($documentation);
40-
}
34+
parent::generate();
4135

4236
$content = ob_get_contents();
4337
ob_end_clean();

0 commit comments

Comments
 (0)