* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ declare(strict_types=1); namespace PrestaShop\CircuitBreaker; use PrestaShop\CircuitBreaker\Contract\ClientInterface; use PrestaShop\CircuitBreaker\Contract\StorageInterface; use PrestaShop\CircuitBreaker\Contract\SystemInterface; use PrestaShop\CircuitBreaker\Transition\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * Symfony implementation of Circuit Breaker. */ final class SymfonyCircuitBreaker extends AdvancedCircuitBreaker { /** * @var EventDispatcherInterface the Symfony Event Dispatcher */ private $eventDispatcher; public function __construct( SystemInterface $system, ClientInterface $client, StorageInterface $storage, EventDispatcherInterface $eventDispatcher ) { $this->eventDispatcher = $eventDispatcher; parent::__construct($system, $client, $storage, new EventDispatcher($eventDispatcher)); } }