Skip to content

Commit

Permalink
Merge pull request #1069 from phpDocumentor/backport/1.x/pr-1063
Browse files Browse the repository at this point in the history
[BUGFIX] Allow escaped version
  • Loading branch information
jaapio authored Sep 9, 2024
2 parents fdb02c2 + 625e5a8 commit 5f1aff2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
24 changes: 23 additions & 1 deletion packages/guides/src/DependencyInjection/GuidesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use function is_int;
use function is_string;
use function pathinfo;
use function trim;
use function var_export;

final class GuidesExtension extends Extension implements CompilerPassInterface, ConfigurationInterface, PrependExtensionInterface
Expand All @@ -68,12 +69,33 @@ static function ($value) {
return var_export($value, true);
}

if (is_string($value)) {
return trim($value, "'");
}

return $value;
},
)
->end()
->end()
->scalarNode('release')
->beforeNormalization()
->always(
// We need to revert the phpize call in XmlUtils. Version is always a string!
static function ($value) {
if (!is_int($value) && !is_string($value)) {
return var_export($value, true);
}

if (is_string($value)) {
return trim($value, "'");
}

return $value;
},
)
->end()
->end()
->scalarNode('release')->end()
->scalarNode('copyright')->end()
->end()
->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1>Document Title</h1>
<dd>Title</dd>
<dt>version:</dt>

<dd>12.4</dd>
<dd>12.4.0</dd>
<dt>release:</dt>

<dd>12.4.9-dev</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
>
<project
title="Title"
version="12.4"
version="12.4.0"
release="12.4.9-dev"
copyright="since 1998 phpDocumentor Team and Contributors"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
>
<project
title="Render guides"
version="3.0"
version="'3.0'"
release="3.0.0"
/>
</guides>

0 comments on commit 5f1aff2

Please sign in to comment.