Skip to content

Commit 9ead98e

Browse files
committed
Use new configuration node depreciation method
1 parent b55ab43 commit 9ead98e

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

DependencyInjection/Configuration.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ public function getConfigTreeBuilder()
6666
->defaultTrue()
6767
->end()
6868
->arrayNode('trusted_proxies')
69+
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 3.3. Use the Request::setTrustedProxies() method in your front controller instead.')
6970
->beforeNormalization()
7071
->ifTrue(function ($v) {
71-
@trigger_error('The "framework.trusted_proxies" configuration key has been deprecated in Symfony 3.3. Use the Request::setTrustedProxies() method in your front controller instead.', E_USER_DEPRECATED);
72-
7372
return !is_array($v) && null !== $v;
7473
})
7574
->then(function ($v) { return is_bool($v) ? array() : preg_split('/\s*,\s*/', $v); })
@@ -663,8 +662,9 @@ private function addValidationSection(ArrayNodeDefinition $rootNode)
663662
->{!class_exists(FullStack::class) && class_exists(Validation::class) ? 'canBeDisabled' : 'canBeEnabled'}()
664663
->children()
665664
->scalarNode('cache')
665+
// Can be removed in 4.0, when validator.mapping.cache.doctrine.apc is removed
666+
->setDeprecated('The "%path%.%node%" option is deprecated since Symfony 3.2 and will be removed in 4.0. Configure the "cache.validator" service under "framework.cache.pools" instead.')
666667
->beforeNormalization()
667-
// Can be removed in 4.0, when validator.mapping.cache.doctrine.apc is removed
668668
->ifString()->then(function ($v) {
669669
if ('validator.mapping.cache.doctrine.apc' === $v && !class_exists('Doctrine\Common\Cache\ApcCache')) {
670670
throw new LogicException('Doctrine APC cache for the validator cannot be enabled as the Doctrine Cache package is not installed.');
@@ -727,7 +727,9 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode)
727727
->{!class_exists(FullStack::class) && class_exists(Serializer::class) ? 'canBeDisabled' : 'canBeEnabled'}()
728728
->children()
729729
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && class_exists(Annotation::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
730-
->scalarNode('cache')->end()
730+
->scalarNode('cache')
731+
->setDeprecated('The "%path%.%node%" option is deprecated since Symfony 3.1 and will be removed in 4.0. Configure the "cache.serializer" service under "framework.cache.pools" instead.')
732+
->end()
731733
->scalarNode('name_converter')->end()
732734
->scalarNode('circular_reference_handler')->end()
733735
->arrayNode('mapping')

DependencyInjection/FrameworkExtension.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,8 +1198,6 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
11981198
}
11991199

12001200
if (isset($config['cache']) && $config['cache']) {
1201-
@trigger_error('The "framework.validation.cache" option is deprecated since Symfony 3.2 and will be removed in 4.0. Configure the "cache.validator" service under "framework.cache.pools" instead.', E_USER_DEPRECATED);
1202-
12031201
$container->setParameter(
12041202
'validator.mapping.cache.prefix',
12051203
'validator_'.$this->getKernelRootHash($container)
@@ -1454,8 +1452,6 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
14541452
$container->getDefinition('serializer.mapping.cache_warmer')->replaceArgument(0, $serializerLoaders);
14551453

14561454
if (isset($config['cache']) && $config['cache']) {
1457-
@trigger_error('The "framework.serializer.cache" option is deprecated since Symfony 3.1 and will be removed in 4.0. Configure the "cache.serializer" service under "framework.cache.pools" instead.', E_USER_DEPRECATED);
1458-
14591455
$container->setParameter(
14601456
'serializer.mapping.cache.prefix',
14611457
'serializer_'.$this->getKernelRootHash($container)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/cache": "~3.4|~4.0",
2222
"symfony/class-loader": "~3.2",
2323
"symfony/dependency-injection": "~3.4|~4.0",
24-
"symfony/config": "~3.3|~4.0",
24+
"symfony/config": "~3.4|~4.0",
2525
"symfony/event-dispatcher": "^3.3.1|~4.0",
2626
"symfony/http-foundation": "~3.3|~4.0",
2727
"symfony/http-kernel": "~3.4|~4.0",

0 commit comments

Comments
 (0)