[FrameworkBundle] Mention that the described service has been removed in debug:container
This commit is contained in:
parent
519ba3cddb
commit
45446e891a
@ -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)]);
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user