ry 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' : ''); } $last = array_pop($alternatives); return sprintf($format, $alternatives ? implode('", "', $alternatives) : $last, $alternatives ? sprintf(' %s "%s"', $separator, $last) : ''); } }