Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\DependencyInjection\Exception; Chris@0: Chris@0: /** Chris@0: * This exception is thrown when a circular reference is detected. Chris@0: * Chris@0: * @author Johannes M. Schmitt Chris@0: */ Chris@0: class ServiceCircularReferenceException extends RuntimeException Chris@0: { Chris@0: private $serviceId; Chris@0: private $path; Chris@0: Chris@0: public function __construct($serviceId, array $path, \Exception $previous = null) Chris@0: { Chris@0: parent::__construct(sprintf('Circular reference detected for service "%s", path: "%s".', $serviceId, implode(' -> ', $path)), 0, $previous); Chris@0: Chris@0: $this->serviceId = $serviceId; Chris@0: $this->path = $path; Chris@0: } Chris@0: Chris@0: public function getServiceId() Chris@0: { Chris@0: return $this->serviceId; Chris@0: } Chris@0: Chris@0: public function getPath() Chris@0: { Chris@0: return $this->path; Chris@0: } Chris@0: }