include dynamic services in list of alternatives
This commit is contained in:
parent
7b383a9788
commit
428b5cc6a8
@ -288,10 +288,10 @@ class Container implements IntrospectableContainerInterface
|
||||
}
|
||||
|
||||
$alternatives = array();
|
||||
foreach ($this->services as $key => $associatedService) {
|
||||
$lev = levenshtein($id, $key);
|
||||
if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) {
|
||||
$alternatives[] = $key;
|
||||
foreach ($this->getServiceIds() as $knownId) {
|
||||
$lev = levenshtein($id, $knownId);
|
||||
if ($lev <= strlen($id) / 3 || false !== strpos($knownId, $id)) {
|
||||
$alternatives[] = $knownId;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$sc = new ProjectServiceContainer();
|
||||
$sc->set('foo', $foo = new \stdClass());
|
||||
$sc->set('bar', $foo = new \stdClass());
|
||||
$sc->set('baz', $foo = new \stdClass());
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user