Skip to content

Commit

Permalink
Merge pull request #33 from mmenozzi/patch-1
Browse files Browse the repository at this point in the history
Fix BuilderEvent to work with both Symfony 4 and 5
  • Loading branch information
loevgaard authored Sep 23, 2021
2 parents f04e854 + ff2399b commit 56e6e37
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Event/BuilderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,21 @@

use Setono\SyliusFacebookPlugin\Builder\BuilderInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface;

final class BuilderEvent extends Event
if (is_subclass_of(EventDispatcherInterface::class, ContractsEventDispatcherInterface::class)) {
abstract class BCEvent extends ContractsEvent
{
}
} else {
abstract class BCEvent extends Event
{
}
}

final class BuilderEvent extends BCEvent
{
private BuilderInterface $builder;

Expand Down

0 comments on commit 56e6e37

Please sign in to comment.