Skip to content

Conversation

pmiroslawski
Copy link

No description provided.

@sokil
Copy link
Owner

sokil commented Sep 9, 2020

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

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 )))

@pmiroslawski
Copy link
Author

Ok, I've added a new PR #179 and I'm closing this one.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants