mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-14 04:01:30 +00:00
updated streamline-setup v2
This commit is contained in:
+7
-12
@@ -30,25 +30,20 @@ use Symfony\Contracts\Service\ResetInterface;
|
||||
*/
|
||||
class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterface
|
||||
{
|
||||
protected ?LoggerInterface $logger;
|
||||
protected Stopwatch $stopwatch;
|
||||
|
||||
/**
|
||||
* @var \SplObjectStorage<WrappedListener, array{string, string}>|null
|
||||
*/
|
||||
private ?\SplObjectStorage $callStack = null;
|
||||
private EventDispatcherInterface $dispatcher;
|
||||
private array $wrappedListeners = [];
|
||||
private array $orphanedEvents = [];
|
||||
private ?RequestStack $requestStack;
|
||||
private string $currentRequestHash = '';
|
||||
|
||||
public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, ?LoggerInterface $logger = null, ?RequestStack $requestStack = null)
|
||||
{
|
||||
$this->dispatcher = $dispatcher;
|
||||
$this->stopwatch = $stopwatch;
|
||||
$this->logger = $logger;
|
||||
$this->requestStack = $requestStack;
|
||||
public function __construct(
|
||||
private EventDispatcherInterface $dispatcher,
|
||||
protected Stopwatch $stopwatch,
|
||||
protected ?LoggerInterface $logger = null,
|
||||
private ?RequestStack $requestStack = null,
|
||||
) {
|
||||
}
|
||||
|
||||
public function addListener(string $eventName, callable|array $listener, int $priority = 0): void
|
||||
@@ -115,7 +110,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
|
||||
$currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';
|
||||
|
||||
if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
|
||||
$this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
|
||||
$this->logger->debug(\sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
|
||||
}
|
||||
|
||||
$this->preProcess($eventName);
|
||||
|
||||
Reference in New Issue
Block a user