mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
N°7920 - laminas-mail is an abandoned package, replace it with symfony/mailer (#742)
* N°7920 - laminas-mail is an abandoned package, replace it with symfony/mailer * Fix composer following merge
This commit is contained in:
@@ -26,16 +26,15 @@ class_exists(NotFoundExceptionInterface::class);
|
||||
*/
|
||||
trait ServiceLocatorTrait
|
||||
{
|
||||
private array $factories;
|
||||
private array $loading = [];
|
||||
private array $providedTypes;
|
||||
|
||||
/**
|
||||
* @param array<string, callable> $factories
|
||||
*/
|
||||
public function __construct(array $factories)
|
||||
{
|
||||
$this->factories = $factories;
|
||||
public function __construct(
|
||||
private array $factories,
|
||||
) {
|
||||
}
|
||||
|
||||
public function has(string $id): bool
|
||||
@@ -91,16 +90,16 @@ trait ServiceLocatorTrait
|
||||
} else {
|
||||
$last = array_pop($alternatives);
|
||||
if ($alternatives) {
|
||||
$message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last);
|
||||
$message = \sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last);
|
||||
} else {
|
||||
$message = sprintf('only knows about the "%s" service.', $last);
|
||||
$message = \sprintf('only knows about the "%s" service.', $last);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->loading) {
|
||||
$message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message);
|
||||
$message = \sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message);
|
||||
} else {
|
||||
$message = sprintf('Service "%s" not found: the current service locator %s', $id, $message);
|
||||
$message = \sprintf('Service "%s" not found: the current service locator %s', $id, $message);
|
||||
}
|
||||
|
||||
return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface {
|
||||
@@ -109,7 +108,7 @@ trait ServiceLocatorTrait
|
||||
|
||||
private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface
|
||||
{
|
||||
return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface {
|
||||
return new class(\sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user