Skip to content

Commit

Permalink
Merge pull request #414 from garak/deprecate-option
Browse files Browse the repository at this point in the history
deprecate "container_aware" option
  • Loading branch information
garak authored Sep 19, 2019
2 parents 791e803 + 66d54e1 commit cd22849
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public function getConfigTreeBuilder()
->addDefaultsIfNotSet()
->children()
->booleanNode('builder_alias')->defaultTrue()->end()
->booleanNode('container_aware')->defaultTrue()->end()
->booleanNode('builder_service')->defaultTrue()->end()
->booleanNode('container_aware')->setDeprecated('The "%node%" option is deprecated and will be removed in version 3.')->defaultTrue()->end()
->booleanNode('builder_service')->setDeprecated('The "%node%" option is deprecated and will be removed in version 3.')->defaultTrue()->end()
->end()
->end()
->arrayNode('twig')
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/doc/disabling_providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ configuration:
knp_menu:
providers:
builder_alias: false # disable the builder-alias-based provider
builder_service: false
container_aware: true # keep this one enabled. Can be omitted as it is the default
builder_service: false # this option is deprecated
container_aware: true # this option is deprecated
.. note::

Expand Down
3 changes: 3 additions & 0 deletions tests/DependencyInjection/KnpMenuExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public function testDisableBuilderAliasProvider()
$this->assertTrue($container->getDefinition('knp_menu.menu_provider.container_aware')->hasTag('knp_menu.provider'), 'The ContainerAwareProvider is enabled');
}

/**
* @group legacy
*/
public function testDisableContainerAwareProvider()
{
$container = new ContainerBuilder();
Expand Down

0 comments on commit cd22849

Please sign in to comment.