return $message;
} private function createTypeAlternatives(ContainerBuilder
$container, TypedReference
$reference): string
{ // try suggesting available aliases first
if ($message =
$this->
getAliasesSuggestionForType($container,
$type =
$reference->
getType())) { return ' '.
$message;
} if (!
isset($this->ambiguousServiceTypes
)) { $this->
populateAvailableTypes($container);
} $servicesAndAliases =
$container->
getServiceIds();
if (null
!== ($autowiringAliases =
$this->autowiringAliases
[$type] ?? null
) && !
isset($autowiringAliases[''
])) { return sprintf(' Available autowiring aliases for this %s are: "$%s".',
class_exists($type, false
) ? 'class' : 'interface',
implode('", "$',
$autowiringAliases));
} if (!
$container->
has($type) && false !==
$key =
array_search(strtolower($type),
array_map('strtolower',
$servicesAndAliases))) { return sprintf(' Did you mean "%s"?',
$servicesAndAliases[$key]);
} elseif (isset($this->ambiguousServiceTypes
[$type])) { $message =
sprintf('one of these existing services: "%s"',
implode('", "',
$this->ambiguousServiceTypes
[$type]));
}