diff --git a/packages/guides/src/DependencyInjection/GuidesExtension.php b/packages/guides/src/DependencyInjection/GuidesExtension.php index 89904c0d4..4ed16c9b2 100644 --- a/packages/guides/src/DependencyInjection/GuidesExtension.php +++ b/packages/guides/src/DependencyInjection/GuidesExtension.php @@ -59,7 +59,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->arrayNode('project') ->children() ->scalarNode('title')->end() - ->scalarNode('version') + ->node('version', 'scalar') ->beforeNormalization() ->always( // We need to revert the phpize call in XmlUtils. Version is always a string! @@ -68,12 +68,33 @@ static function ($value) { return var_export($value, true); } + if (is_string($value)) { + return trim($value, "'"); + } + + return $value; + }, + ) + ->end() + ->end() + ->node('release', 'scalar') + ->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 @@