1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace Symfony\Component\EventDispatcher;
- use Psr\EventDispatcher\StoppableEventInterface;
- use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
- final class LegacyEventProxy extends Event
- {
- private $event;
-
- public function __construct($event)
- {
- $this->event = $event;
- }
-
- public function getEvent()
- {
- return $this->event;
- }
- public function isPropagationStopped(): bool
- {
- if (!$this->event instanceof ContractsEvent && !$this->event instanceof StoppableEventInterface) {
- return false;
- }
- return $this->event->isPropagationStopped();
- }
- public function stopPropagation()
- {
- if (!$this->event instanceof ContractsEvent) {
- return;
- }
- $this->event->stopPropagation();
- }
- public function __call($name, $args)
- {
- return $this->event->{$name}(...$args);
- }
- }
|