Skip to content

Commit 52d9f5d

Browse files
authored
Merge pull request #602 from phpDocumentor/bugfix/output-formats
[BUGFIX] Treat single output formats as array
2 parents 7d7113b + a448da4 commit 52d9f5d

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

guides.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
log-path="php://stder"
1212
>
1313
<project title="phpDocumentor Guides"/>
14-
<output-format>html</output-format>
15-
<output-format>intersphinx</output-format>
1614

1715
<extension class="phpDocumentor\Guides\Bootstrap"/>
1816
</guides>

packages/guides/src/DependencyInjection/GuidesExtension.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ public function getConfigTreeBuilder(): TreeBuilder
5656
->scalarNode('output')->end()
5757
->scalarNode('input_format')->end()
5858
->arrayNode('output_format')
59-
->defaultValue([])
59+
->defaultValue(['html', 'intersphinx'])
60+
->beforeNormalization()
61+
->ifString()
62+
->then(static function ($value) {
63+
return [$value];
64+
})
65+
->end()
6066
->scalarPrototype()->end()
6167
->end()
6268
->scalarNode('log_path')->end()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Document Title</title>
5+
</head>
6+
<body>
7+
<div class="section" id="document-title">
8+
<h1>Document Title</h1>
9+
<p>Lorem Ipsum Dolor.</p>
10+
</div>
11+
</body>
12+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<guides xmlns="https://www.phpdoc.org/guides"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://www.phpdoc.org/guides packages/guides-cli/resources/schema/guides.xsd">
5+
<output-format>html</output-format>
6+
7+
<extension class="phpDocumentor\Guides\Bootstrap"/>
8+
</guides>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
==============
2+
Document Title
3+
==============
4+
5+
Lorem Ipsum Dolor.

0 commit comments

Comments
 (0)