X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fsymfony%2Fdependency-injection%2FException%2FServiceNotFoundException.php;fp=vendor%2Fsymfony%2Fdependency-injection%2FException%2FServiceNotFoundException.php;h=59567074ccb2cf99ee3106e41176a23eaf4e5d04;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=e65da506bb5151b77e51cd771635ad6577276895;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/symfony/dependency-injection/Exception/ServiceNotFoundException.php b/vendor/symfony/dependency-injection/Exception/ServiceNotFoundException.php index e65da506b..59567074c 100644 --- a/vendor/symfony/dependency-injection/Exception/ServiceNotFoundException.php +++ b/vendor/symfony/dependency-injection/Exception/ServiceNotFoundException.php @@ -11,19 +11,24 @@ namespace Symfony\Component\DependencyInjection\Exception; +use Psr\Container\NotFoundExceptionInterface; + /** * This exception is thrown when a non-existent service is requested. * * @author Johannes M. Schmitt */ -class ServiceNotFoundException extends InvalidArgumentException +class ServiceNotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface { private $id; private $sourceId; + private $alternatives; - public function __construct($id, $sourceId = null, \Exception $previous = null, array $alternatives = array()) + public function __construct($id, $sourceId = null, \Exception $previous = null, array $alternatives = array(), $msg = null) { - if (null === $sourceId) { + if (null !== $msg) { + // no-op + } elseif (null === $sourceId) { $msg = sprintf('You have requested a non-existent service "%s".', $id); } else { $msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id); @@ -42,6 +47,7 @@ class ServiceNotFoundException extends InvalidArgumentException $this->id = $id; $this->sourceId = $sourceId; + $this->alternatives = $alternatives; } public function getId() @@ -53,4 +59,9 @@ class ServiceNotFoundException extends InvalidArgumentException { return $this->sourceId; } + + public function getAlternatives() + { + return $this->alternatives; + } }