Skip to content

[BUGFIX] do not parse version config node #1063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading