Skip to content

Commit cd22849

Browse files
authored
Merge pull request #414 from garak/deprecate-option
deprecate "container_aware" option
2 parents 791e803 + 66d54e1 commit cd22849

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/DependencyInjection/Configuration.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function getConfigTreeBuilder()
3434
->addDefaultsIfNotSet()
3535
->children()
3636
->booleanNode('builder_alias')->defaultTrue()->end()
37-
->booleanNode('container_aware')->defaultTrue()->end()
38-
->booleanNode('builder_service')->defaultTrue()->end()
37+
->booleanNode('container_aware')->setDeprecated('The "%node%" option is deprecated and will be removed in version 3.')->defaultTrue()->end()
38+
->booleanNode('builder_service')->setDeprecated('The "%node%" option is deprecated and will be removed in version 3.')->defaultTrue()->end()
3939
->end()
4040
->end()
4141
->arrayNode('twig')

src/Resources/doc/disabling_providers.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ configuration:
1414
knp_menu:
1515
providers:
1616
builder_alias: false # disable the builder-alias-based provider
17-
builder_service: false
18-
container_aware: true # keep this one enabled. Can be omitted as it is the default
17+
builder_service: false # this option is deprecated
18+
container_aware: true # this option is deprecated
1919
2020
.. note::
2121

tests/DependencyInjection/KnpMenuExtensionTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public function testDisableBuilderAliasProvider()
6565
$this->assertTrue($container->getDefinition('knp_menu.menu_provider.container_aware')->hasTag('knp_menu.provider'), 'The ContainerAwareProvider is enabled');
6666
}
6767

68+
/**
69+
* @group legacy
70+
*/
6871
public function testDisableContainerAwareProvider()
6972
{
7073
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)