Skip to content

Commit 82478ba

Browse files
author
abluchet
committed
Use symfony 3.4 configuration deprecation
1 parent cef2464 commit 82478ba

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,9 @@ public function getConfigTreeBuilder()
5858
->defaultValue('0.0.0')
5959
->end()
6060
->scalarNode('default_operation_path_resolver')
61-
->beforeNormalization()->always(function ($v) {
62-
@trigger_error('The use of the `default_operation_path_resolver` has been deprecated in 2.1 and will be removed in 3.0. Use `path_segment_name_generator` instead.', E_USER_DEPRECATED);
63-
64-
return $v;
65-
})->end()
6661
->defaultValue('api_platform.operation_path_resolver.underscore')
67-
->info('[Deprecated] Specify the default operation path resolver to use for generating resources operations path.')
62+
->setDeprecated('The use of the `default_operation_path_resolver` has been deprecated in 2.1 and will be removed in 3.0. Use `path_segment_name_generator` instead.')
63+
->info('Specify the default operation path resolver to use for generating resources operations path.')
6864
->end()
6965
->scalarNode('name_converter')->defaultNull()->info('Specify a name converter to use.')->end()
7066
->scalarNode('path_segment_name_generator')->defaultValue('api_platform.path_segment_name_generator.underscore')->info('Specify a path name generator to use.')->end()
@@ -87,15 +83,9 @@ public function getConfigTreeBuilder()
8783
->end()
8884
->booleanNode('enable_fos_user')->defaultValue(class_exists(FOSUserBundle::class))->info('Enable the FOSUserBundle integration.')->end()
8985
->booleanNode('enable_nelmio_api_doc')
90-
->beforeNormalization()->always(function ($v) {
91-
if ($v) {
92-
@trigger_error('Enabling the NelmioApiDocBundle integration has been deprecated in 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform.', E_USER_DEPRECATED);
93-
}
94-
95-
return $v;
96-
})->end()
9786
->defaultValue(false)
98-
->info('[Deprecated] Enable the NelmioApiDocBundle integration.')
87+
->setDeprecated('Enabling the NelmioApiDocBundle integration has been deprecated in 2.2 and will be removed in 3.0. NelmioApiDocBundle 3 has native support for API Platform.')
88+
->info('Enable the NelmioApiDocBundle integration.')
9989
->end()
10090
->booleanNode('enable_swagger')->defaultValue(true)->info('Enable the Swagger documentation and export.')->end()
10191
->booleanNode('enable_swagger_ui')->defaultValue(class_exists(TwigBundle::class))->info('Enable Swagger ui.')->end()

0 commit comments

Comments
 (0)