} elseif (is_subclass_of($class, ServiceSubscriberInterface::
class)) { $msg[] =
sprintf('Unless you need extra laziness, try using dependency injection instead. Otherwise, you need to declare it using "%s::getSubscribedServices()".',
preg_replace('/([^\\\\]++\\\\)++/', '',
$class));
} else { $msg[] = 'Try using dependency injection instead.';
} return new ServiceNotFoundException($id,
end($this->loading
) ?: null, null,
[],
implode(' ',
$msg));
} private function createCircularReferenceException(string
$id, array
$path): ContainerExceptionInterface
{ return new ServiceCircularReferenceException($id,
$path);
} private function formatAlternatives(array
$alternatives = null, string
$separator = 'and'
): string
{ $format = '"%s"%s';
if (null ===
$alternatives) { if (!
$alternatives =
array_keys($this->factories
)) { return 'is empty...';
} $format =
sprintf('only knows about the %s service%s.',
$format, 1 < \
count($alternatives) ? 's' : ''
);
}