for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
namespace Venta\Container\Exception;
use Exception;
use Interop\Container\Exception\ContainerException as ContainerExceptionInterface;
use RuntimeException;
/**
* Class ContainerException
*
* @package Venta\Container\Exception
*/
abstract class ContainerException extends RuntimeException implements ContainerExceptionInterface
{
* List of entries referred to cause a circular reference.
* @var array
protected $referenceChain;
* Container entry identifier.
* @var string
protected $serviceId;
* CircularReferenceException constructor.
* @param string $entryId
* @param array $referenceChain
* @param Exception|null $previous
* @internal param string $message
public function __construct(string $entryId, array $referenceChain = [], Exception $previous = null)
$this->serviceId = $entryId;
$this->referenceChain = $referenceChain;
parent::__construct($this->createMessage($previous), 0, $previous);
}
* Get reference chain.
* @return array
public function getReferenceChain(): array
return $this->referenceChain;
* Get container entry identifier which caused a circular reference error.
* @return string
public function getServiceId(): string
return $this->serviceId;
* Returns exception message
* @param Exception $previous
abstract protected function createMessage(Exception $previous = null): string;