bug #31525 [FrameworkBundle] Mention that the described service has been removed in debug:container (chalasr)
This PR was merged into the 4.4-dev branch.
Discussion
----------
[FrameworkBundle] Mention that the described service has been removed in debug:container
| Q | A
| ------------- | ---
| Branch? | maste
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/29603
| License | MIT
| Doc PR | n/a
![Screenshot 2019-05-17 at 16 30 59](https://user-images.githubusercontent.com/7502063/57935100-5618d500-78c1-11e9-8c92-b079cc593dec.png)
Commits
-------
45446e891a
[FrameworkBundle] Mention that the described service has been removed in debug:container
This commit is contained in:
commit
5bf7759f3d
@ -163,6 +163,10 @@ EOF
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$helper->describe($io, $object, $options);
|
$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) {
|
} catch (ServiceNotFoundException $e) {
|
||||||
if ('' !== $e->getId() && '@' === $e->getId()[0]) {
|
if ('' !== $e->getId() && '@' === $e->getId()[0]) {
|
||||||
throw new ServiceNotFoundException($e->getId(), $e->getSourceId(), null, [substr($e->getId(), 1)]);
|
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']);
|
$tester->run(['command' => 'debug:container']);
|
||||||
$this->assertContains('public', $tester->getDisplay());
|
$this->assertContains('public', $tester->getDisplay());
|
||||||
$this->assertContains('private_alias', $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