Skip to content

Commit

Permalink
Add deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Apr 6, 2021
1 parent a800c2a commit ae65aa0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ae65aa0

Please sign in to comment.