[DependencyInjection] renamed ContainerBuilder::remove() as removeDefinition() to be more consistent with other definition-related methods
This commit is contained in:
parent
cdf706d357
commit
470baaab9f
@ -76,12 +76,12 @@ class AsseticExtension extends Extension
|
||||
$loader->load('controller.xml');
|
||||
$container->setParameter('assetic.twig_extension.class', '%assetic.twig_extension.dynamic.class%');
|
||||
$container->getDefinition('assetic.helper.dynamic')->addTag('templating.helper', array('alias' => 'assetic'));
|
||||
$container->remove('assetic.helper.static');
|
||||
$container->removeDefinition('assetic.helper.static');
|
||||
} else {
|
||||
$loader->load('asset_writer.xml');
|
||||
$container->setParameter('assetic.twig_extension.class', '%assetic.twig_extension.static.class%');
|
||||
$container->getDefinition('assetic.helper.static')->addTag('templating.helper', array('alias' => 'assetic'));
|
||||
$container->remove('assetic.helper.dynamic');
|
||||
$container->removeDefinition('assetic.helper.dynamic');
|
||||
}
|
||||
|
||||
// register config resources
|
||||
|
@ -25,9 +25,9 @@ class CheckClosureFilterPass implements CompilerPassInterface
|
||||
{
|
||||
if ($container->hasDefinition('assetic.filter.closure.jar') &&
|
||||
$container->getParameterBag()->resolveValue($container->getParameter('assetic.filter.closure.jar'))) {
|
||||
$container->remove('assetic.filter.closure.api');
|
||||
$container->removeDefinition('assetic.filter.closure.api');
|
||||
} elseif ($container->hasDefinition('assetic.filter.closure.api')) {
|
||||
$container->remove('assetic.filter.closure.jar');
|
||||
$container->removeDefinition('assetic.filter.closure.jar');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,13 +31,13 @@ class TemplatingPass implements CompilerPassInterface
|
||||
|
||||
if (!in_array('twig', $engines)) {
|
||||
foreach ($container->findTaggedServiceIds('assetic.templating.twig') as $id => $attr) {
|
||||
$container->remove($id);
|
||||
$container->removeDefinition($id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array('php', $engines)) {
|
||||
foreach ($container->findTaggedServiceIds('assetic.templating.php') as $id => $attr) {
|
||||
$container->remove($id);
|
||||
$container->removeDefinition($id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -138,13 +138,13 @@ class SecurityExtension extends Extension
|
||||
private function createRoleHierarchy($config, ContainerBuilder $container)
|
||||
{
|
||||
if (!isset($config['role_hierarchy'])) {
|
||||
$container->remove('security.access.role_hierarchy_voter');
|
||||
$container->removeDefinition('security.access.role_hierarchy_voter');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$container->setParameter('security.role_hierarchy.roles', $config['role_hierarchy']);
|
||||
$container->remove('security.access.simple_role_voter');
|
||||
$container->removeDefinition('security.access.simple_role_voter');
|
||||
}
|
||||
|
||||
private function createAuthorization($config, ContainerBuilder $container)
|
||||
|
@ -22,7 +22,7 @@ class RemoveAbstractDefinitionsPass implements CompilerPassInterface
|
||||
|
||||
foreach ($container->getDefinitions() as $id => $definition) {
|
||||
if ($definition->isAbstract()) {
|
||||
$container->remove($id);
|
||||
$container->removeDefinition($id);
|
||||
$compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'abstract'));
|
||||
}
|
||||
}
|
||||
|
@ -72,10 +72,10 @@ class RemoveUnusedDefinitionsPass implements RepeatablePassInterface
|
||||
if (1 === count($referencingAliases) && false === $isReferenced) {
|
||||
$container->setDefinition((string) reset($referencingAliases), $definition);
|
||||
$definition->setPublic(true);
|
||||
$container->remove($id);
|
||||
$container->removeDefinition($id);
|
||||
$compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'replaces alias '.reset($referencingAliases)));
|
||||
} else if (0 === count($referencingAliases) && false === $isReferenced) {
|
||||
$container->remove($id);
|
||||
$container->removeDefinition($id);
|
||||
$compiler->addLogMessage($formatter->formatRemoveService($this, $id, 'unused'));
|
||||
$hasChanged = true;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface
|
||||
|
||||
$definition->setPublic(true);
|
||||
$container->setDefinition($id, $definition);
|
||||
$container->remove($aliasId);
|
||||
$container->removeDefinition($aliasId);
|
||||
|
||||
$this->updateReferences($container, $aliasId, $id);
|
||||
|
||||
|
@ -241,11 +241,11 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a service.
|
||||
* Removes a service definition.
|
||||
*
|
||||
* @param string $id The service identifier
|
||||
*/
|
||||
public function remove($id)
|
||||
public function removeDefinition($id)
|
||||
{
|
||||
unset($this->definitions[strtolower($id)]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user