This is good change but i think it is road to nowhere, because verstion 1.0 try to support php 5.4 and this forces you to add code like
if (class_exists('Symfony\Contracts\EventDispatcher\Event'))
{ {
/** class Event extends \Symfony\Contracts\EventDispatcher\Event
Also there was my mistake to inject dependency to symfony instead of depending from interface.
If you want to upgrade event manager i thing better way
To fix branch 2.0-alpha, where support of PHP < 7.1 completely removed
To limit minimum required version of php in 2.0-alpha to php": ">=7.2.0
Just to inject psr/event-dispatcher and add symfony/event-dispatcher only as suggestion
Create EventFactoryInterface that creates StoppableEventInterface for all events
Add implementation of SymfonyEventFactory and maybe also for some other event dispatchers
Use this factory instead of new SaveAfterEvent() like $this->eventFactory->createSaveAfterEvent()
Then anyone who want use symfony event dispatcher just configure client with predefined factory and instance of dispatcher, and also this adds posibility to inject any other event dispatcher compatible with psr of write adapter
If you made this change i'll make release with 2.0 )))
Hi. Thanks for interest to project.
This is good change but i think it is road to nowhere, because verstion 1.0 try to support php 5.4 and this forces you to add code like
Also there was my mistake to inject dependency to symfony instead of depending from interface.
If you want to upgrade event manager i thing better way
2.0-alpha
, where support of PHP < 7.1 completely removed2.0-alpha
tophp": ">=7.2.0
psr/event-dispatcher
and addsymfony/event-dispatcher
only as suggestionEventFactoryInterface
that createsStoppableEventInterface
for all eventsSymfonyEventFactory
and maybe also for some other event dispatchersnew SaveAfterEvent()
like$this->eventFactory->createSaveAfterEvent()
Then anyone who want use symfony event dispatcher just configure client with predefined factory and instance of dispatcher, and also this adds posibility to inject any other event dispatcher compatible with psr of write adapter
If you made this change i'll make release with 2.0 )))