Skip to content

Commit

Permalink
DateTime - Fix BC break Deserialize formats
Browse files Browse the repository at this point in the history
  • Loading branch information
iksss-invia committed Oct 18, 2024
1 parent 565c2ee commit cefb98e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private function addHandlersSection(NodeBuilder $builder)
->scalarNode('default_format')->defaultValue(\DateTime::RFC3339)->end()
->arrayNode('default_deserialization_formats')
->scalarPrototype()->end()
->defaultValue([\DateTime::RFC3339])
->defaultValue([])
->end()
->scalarNode('default_timezone')->defaultValue(date_default_timezone_get())->end()
->scalarNode('cdata')->defaultTrue()->end()
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/JMSSerializerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private function loadInternal(array $config, ScopedContainer $container, array $
->replaceArgument(0, $config['handlers']['datetime']['default_format'])
->replaceArgument(1, $config['handlers']['datetime']['default_timezone'])
->replaceArgument(2, $config['handlers']['datetime']['cdata'])
->replaceArgument(3, $config['handlers']['datetime']['default_deserialization_formats']);
->replaceArgument(3, [] === $config['handlers']['datetime']['default_deserialization_formats'] ? [$config['handlers']['datetime']['default_format']] : $config['handlers']['datetime']['default_deserialization_formats']);

$container->getDefinition('jms_serializer.array_collection_handler')
->replaceArgument(0, $config['handlers']['array_collection']['initialize_excluded']);
Expand Down

0 comments on commit cefb98e

Please sign in to comment.