Skip to content

Commit

Permalink
Fix ltinig issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Rainville committed Dec 2, 2024
1 parent 0c755ac commit f37fee7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/AsyncEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
namespace ArchiPro\EventDispatcher;

use function Amp\async;
use function Amp\Future\await;

use Amp\Cancellation;

use Amp\Future;

use function Amp\Future\await;

use function Amp\Future\awaitAll;

use Amp\NullCancellation;
Expand All @@ -28,7 +30,7 @@
*/
class AsyncEventDispatcher implements EventDispatcherInterface
{
const THROW_ON_ERROR = 0b0001;
public const THROW_ON_ERROR = 0b0001;

/**
* @param ListenerProviderInterface $listenerProvider The provider of event listeners
Expand Down
12 changes: 5 additions & 7 deletions tests/AsyncEventDispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
use ArchiPro\EventDispatcher\Event\AbstractStoppableEvent;
use ArchiPro\EventDispatcher\ListenerProvider;
use ArchiPro\EventDispatcher\Tests\Fixture\TestEvent;
use ColinODell\PsrTestLogger\TestLogger;
use Exception;
use PHPUnit\Framework\TestCase;
use Revolt\EventLoop;
use ColinODell\PsrTestLogger\TestLogger;
use Throwable;

/**
* Test cases for AsyncEventDispatcher.
Expand Down Expand Up @@ -163,14 +161,14 @@ public function testDispatchesFailureInOneListenerDoesNotAffectOthers(): void

$futureEvent = $this->dispatcher->dispatch($event);

$futureEvent = $futureEvent->await();
$futureEvent->await();

$this->assertTrue(
$futureEvent->calledOnce,
$event->calledOnce,
'The first listener should have been called'
);
$this->assertTrue(
$futureEvent->calledTwice,
$event->calledTwice,
'The second listener should have been called despite the failure of the first listener'
);

Expand Down Expand Up @@ -235,7 +233,7 @@ public function testThrowsErrors(): void
$this->listenerProvider->addListener(get_class($event), function ($event) {
throw new Exception('This exception will bubble up because we set the THROW_ON_ERROR option');
});

$this->expectException(Exception::class);
$this->expectExceptionMessage('This exception will bubble up because we set the THROW_ON_ERROR option');

Expand Down

0 comments on commit f37fee7

Please sign in to comment.