[FrameworkBundle] Mention that the described service has been removed in debug:container

This commit is contained in:
Robin Chalas 2019-05-17 16:29:46 +02:00
parent 519ba3cddb
commit 45446e891a
2 changed files with 7 additions and 0 deletions

View File

@ -163,6 +163,10 @@ EOF
try {
$helper->describe($io, $object, $options);
if (isset($options['id']) && isset($this->getApplication()->getKernel()->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]) {
throw new ServiceNotFoundException($e->getId(), $e->getSourceId(), null, [substr($e->getId(), 1)]);

View File

@ -63,6 +63,9 @@ class ContainerDebugCommandTest extends WebTestCase
$tester->run(['command' => 'debug:container']);
$this->assertContains('public', $tester->getDisplay());
$this->assertContains('private_alias', $tester->getDisplay());
$tester->run(['command' => 'debug:container', 'name' => 'private_alias']);
$this->assertContains('The "private_alias" service or alias has been removed', $tester->getDisplay());
}
/**