diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 940dbf5e..b1887848 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -36,7 +36,20 @@ public function getConfigTreeBuilder() ->scalarNode('revision_field_name')->defaultValue('rev')->end() ->scalarNode('revision_type_field_name')->defaultValue('revtype')->end() ->scalarNode('revision_table_name')->defaultValue('revisions')->end() - ->scalarNode('revision_id_field_type')->defaultValue('integer')->end() + ->scalarNode('revision_id_field_type') + ->defaultValue('integer') + // NEXT_MAJOR: Use validate() instead. + ->beforeNormalization() + ->always(static function ($value) { + if (null !== $value && !\in_array($value, ['integer', 'string'], true)) { + @trigger_error(sprintf( + 'Passing another value than "integer" and "string" as "revision_id_field_type" is deprecated' + .' since sonata-project/entity-audit-bundle 1.3 and will throw an error in version 2.0.', + ), \E_USER_DEPRECATED); + } + }) + ->end() + ->end() ->arrayNode('service') ->addDefaultsIfNotSet() ->children()