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();
|
$alternatives = array();
|
||||||
foreach ($this->services as $key => $associatedService) {
|
foreach ($this->getServiceIds() as $knownId) {
|
||||||
$lev = levenshtein($id, $key);
|
$lev = levenshtein($id, $knownId);
|
||||||
if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) {
|
if ($lev <= strlen($id) / 3 || false !== strpos($knownId, $id)) {
|
||||||
$alternatives[] = $key;
|
$alternatives[] = $knownId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +219,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$sc = new ProjectServiceContainer();
|
$sc = new ProjectServiceContainer();
|
||||||
$sc->set('foo', $foo = new \stdClass());
|
$sc->set('foo', $foo = new \stdClass());
|
||||||
$sc->set('bar', $foo = new \stdClass());
|
|
||||||
$sc->set('baz', $foo = new \stdClass());
|
$sc->set('baz', $foo = new \stdClass());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user