diff --git a/src/Event/FeatureToggleDisabledEvent.php b/src/Event/FeatureToggleDisabledEvent.php index 4ba97670..556a5755 100644 --- a/src/Event/FeatureToggleDisabledEvent.php +++ b/src/Event/FeatureToggleDisabledEvent.php @@ -2,10 +2,15 @@ namespace Unleash\Client\Event; +use Symfony\Contracts\EventDispatcher\Event; use Unleash\Client\Configuration\Context; use Unleash\Client\DTO\Feature; -final class FeatureToggleDisabledEvent +if (!class_exists(Event::class)) { + require __DIR__ . '/../../stubs/event-dispatcher/Event.php'; +} + +final class FeatureToggleDisabledEvent extends Event { /** * @internal diff --git a/src/Event/FeatureToggleMissingStrategyHandlerEvent.php b/src/Event/FeatureToggleMissingStrategyHandlerEvent.php index bf487ce9..62af3416 100644 --- a/src/Event/FeatureToggleMissingStrategyHandlerEvent.php +++ b/src/Event/FeatureToggleMissingStrategyHandlerEvent.php @@ -2,10 +2,15 @@ namespace Unleash\Client\Event; +use Symfony\Contracts\EventDispatcher\Event; use Unleash\Client\Configuration\Context; use Unleash\Client\DTO\Feature; -final class FeatureToggleMissingStrategyHandlerEvent +if (!class_exists(Event::class)) { + require __DIR__ . '/../../stubs/event-dispatcher/Event.php'; +} + +final class FeatureToggleMissingStrategyHandlerEvent extends Event { /** * @internal diff --git a/src/Event/FeatureToggleNotFoundEvent.php b/src/Event/FeatureToggleNotFoundEvent.php index c5ce92ef..8eb4d2ae 100644 --- a/src/Event/FeatureToggleNotFoundEvent.php +++ b/src/Event/FeatureToggleNotFoundEvent.php @@ -5,6 +5,10 @@ use Symfony\Contracts\EventDispatcher\Event; use Unleash\Client\Configuration\Context; +if (!class_exists(Event::class)) { + require __DIR__ . '/../../stubs/event-dispatcher/Event.php'; +} + final class FeatureToggleNotFoundEvent extends Event { /** diff --git a/stubs/event-dispatcher/Event.php b/stubs/event-dispatcher/Event.php new file mode 100644 index 00000000..be335d89 --- /dev/null +++ b/stubs/event-dispatcher/Event.php @@ -0,0 +1,9 @@ +