diff --git a/packages/guides/src/DependencyInjection/GuidesExtension.php b/packages/guides/src/DependencyInjection/GuidesExtension.php index 89904c0d4..6db4af678 100644 --- a/packages/guides/src/DependencyInjection/GuidesExtension.php +++ b/packages/guides/src/DependencyInjection/GuidesExtension.php @@ -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 @@ -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() diff --git a/tests/Integration/tests/configuration/config-project/expected/index.html b/tests/Integration/tests/configuration/config-project/expected/index.html index a1b6deb4b..a6616fe41 100644 --- a/tests/Integration/tests/configuration/config-project/expected/index.html +++ b/tests/Integration/tests/configuration/config-project/expected/index.html @@ -10,7 +10,7 @@

Document Title

Title
version:
-
12.4
+
12.4.0
release:
12.4.9-dev
diff --git a/tests/Integration/tests/configuration/config-project/input/guides.xml b/tests/Integration/tests/configuration/config-project/input/guides.xml index 08662d48c..f6cab3fc2 100644 --- a/tests/Integration/tests/configuration/config-project/input/guides.xml +++ b/tests/Integration/tests/configuration/config-project/input/guides.xml @@ -5,7 +5,7 @@ > diff --git a/tests/Integration/tests/meta/version-from-guides-xml/input/guides.xml b/tests/Integration/tests/meta/version-from-guides-xml/input/guides.xml index 608bf0953..66a4a6264 100644 --- a/tests/Integration/tests/meta/version-from-guides-xml/input/guides.xml +++ b/tests/Integration/tests/meta/version-from-guides-xml/input/guides.xml @@ -6,7 +6,7 @@ >