public function __construct(ResolverList $list, DependencyResolverInterface $resolver) { $circularReference = []; $chainStarted = false; foreach ($list as $chainLink) { if ($chainLink === $resolver) { $chainStarted = true; } if ($chainStarted) { $circularReference[] = $chainLink->getId(); } } $circularReference[] = $resolver->getId(); $circularReference = implode(" -> ", $circularReference); parent::__construct("Circular reference detected {$circularReference}"); }
public function __construct(ResolverList $list, DependencyResolverInterface $resolver) { parent::__construct(sprintf('The resolverlist object already contains a member with id `%s`', $resolver->getId())); }