diff --git a/tests/Stubs/Guards/IsOddGuard.php b/tests/Stubs/Guards/IsOddGuard.php index 1f04979..e9f2ba4 100644 --- a/tests/Stubs/Guards/IsOddGuard.php +++ b/tests/Stubs/Guards/IsOddGuard.php @@ -4,8 +4,7 @@ namespace Tarfinlabs\EventMachine\Tests\Stubs\Guards; -use Tarfinlabs\EventMachine\ContextManager; -use Tarfinlabs\EventMachine\Behavior\EventBehavior; +use Closure; use Tarfinlabs\EventMachine\Behavior\GuardBehavior; use Tarfinlabs\EventMachine\Tests\Stubs\Machines\TrafficLights\TrafficLightsContext; @@ -15,11 +14,10 @@ class IsOddGuard extends GuardBehavior 'counts.oddCount' => 'integer', ]; - public function __invoke( - TrafficLightsContext|ContextManager $context, - EventBehavior $eventBehavior, - array $arguments = null - ): bool { - return $context->count % 2 === 1; + public function definition(): Closure + { + return function (TrafficLightsContext $context) { + return $context->count % 2 === 1; + }; } } diff --git a/tests/Stubs/Machines/Asd/Actions/DAction.php b/tests/Stubs/Machines/Asd/Actions/DAction.php index 0f2eb8e..a90f06f 100644 --- a/tests/Stubs/Machines/Asd/Actions/DAction.php +++ b/tests/Stubs/Machines/Asd/Actions/DAction.php @@ -5,7 +5,7 @@ namespace Tarfinlabs\EventMachine\Tests\Stubs\Machines\Asd\Actions; use Closure; -use Exception; +use RuntimeException; use Tarfinlabs\EventMachine\Behavior\ActionBehavior; class DAction extends ActionBehavior @@ -13,7 +13,7 @@ class DAction extends ActionBehavior public function definition(): Closure { return function (): void { - throw new Exception('error'); + throw new RuntimeException('error'); }; } }