// No need to process the same target twice
if(isset($seenAliasTargets[$targetId])){ continue; } // Process new target
$seenAliasTargets[$targetId] = true; try{ $definition = $container->getDefinition($targetId); }catch(ServiceNotFoundException $e){ if('' !== $e->getId() && '@' === $e->getId()[0]){ thrownewServiceNotFoundException($e->getId(), $e->getSourceId(), null, [substr($e->getId(), 1)]); }
throw$e; } if($definition->isPublic()){ continue; } // Remove private definition and schedule for replacement
$definition->setPublic($target->isPublic()); $container->setDefinition($definitionId, $definition); $container->removeDefinition($targetId);
// No need to process the same target twice
if(isset($seenAliasTargets[$targetId])){ continue; } // Process new target
$seenAliasTargets[$targetId] = true; try{ $definition = $container->getDefinition($targetId); }catch(ServiceNotFoundException $e){ if('' !== $e->getId() && '@' === $e->getId()[0]){ thrownewServiceNotFoundException($e->getId(), $e->getSourceId(), null, [substr($e->getId(), 1)]); }
throw$e; } if($definition->isPublic()){ continue; } // Remove private definition and schedule for replacement
$definition->setPublic($target->isPublic()); $container->setDefinition($definitionId, $definition); $container->removeDefinition($targetId);
if(isset($options['id']) && isset($kernel->getContainer()->getRemovedIds()[$options['id']])){ $errorIo->note(sprintf('The "%s" service or alias has been removed or inlined when the container was compiled.', $options['id'])); } }catch(ServiceNotFoundException $e){ if('' !== $e->getId() && '@' === $e->getId()[0]){ thrownewServiceNotFoundException($e->getId(), $e->getSourceId(), null, [substr($e->getId(), 1)]); }
throw$e; }
if(!$input->getArgument('name') && !$input->getOption('tag') && !$input->getOption('parameter') && !$input->getOption('env-vars') && !$input->getOption('env-var') && $input->isInteractive()){ if($input->getOption('tags')){ $errorIo->comment('To search for a specific tag, re-run this command with a search term. (e.g. <comment>debug:container --tag=form.type</comment>)'); }elseif($input->getOption('parameters')){ $errorIo->comment('To search for a specific parameter, re-run this command with a search term. (e.g. <comment>debug:container --parameter=kernel.debug</comment>)'); }elseif(!$input->getOption('deprecations')){