Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.1' into u1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
a-menshchikov committed Mar 22, 2023
2 parents 36f3c46 + cab7e18 commit e558ba8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/EventListener/User/DeferredUserListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

#[AsEventListener]
final class DeferredUserListener
{
public function __invoke(CheckPassportEvent $event, string $eventName, EventDispatcherInterface $eventDispatcher): void
#[AsEventListener(CheckPassportEvent::class)]
public function dispatchDeferredEvent(CheckPassportEvent $event, string $eventName, EventDispatcherInterface $eventDispatcher): void
{
$badge = $event->getPassport()->getBadge(DeferredEventBadge::class);
if (!$badge instanceof DeferredEventBadge) {
Expand Down
6 changes: 3 additions & 3 deletions tests/EventListener/User/DeferredUserListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testWithoutBadge(): void
->method('dispatch')
;

(new DeferredUserListener())($event, '', $eventDispatcher);
(new DeferredUserListener())->dispatchDeferredEvent($event, '', $eventDispatcher);
}

public function testBadgeWithoutEvent(): void
Expand All @@ -49,7 +49,7 @@ public function testBadgeWithoutEvent(): void
->method('dispatch')
;

(new DeferredUserListener())($event, '', $eventDispatcher);
(new DeferredUserListener())->dispatchDeferredEvent($event, '', $eventDispatcher);
}

public function testSuccessfulEventDispatching(): void
Expand All @@ -71,6 +71,6 @@ public function testSuccessfulEventDispatching(): void
->with($deferredEvent)
;

(new DeferredUserListener())($event, '', $eventDispatcher);
(new DeferredUserListener())->dispatchDeferredEvent($event, '', $eventDispatcher);
}
}

0 comments on commit e558ba8

Please sign in to comment.