Skip to content

Commit

Permalink
test: fix (WEB-4344)
Browse files Browse the repository at this point in the history
  • Loading branch information
deligoez committed Dec 4, 2023
1 parent bc055c0 commit bf66715
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions tests/Stubs/Guards/IsOddGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
};
}
}
4 changes: 2 additions & 2 deletions tests/Stubs/Machines/Asd/Actions/DAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
namespace Tarfinlabs\EventMachine\Tests\Stubs\Machines\Asd\Actions;

use Closure;
use Exception;
use RuntimeException;
use Tarfinlabs\EventMachine\Behavior\ActionBehavior;

class DAction extends ActionBehavior
{
public function definition(): Closure
{
return function (): void {
throw new Exception('error');
throw new RuntimeException('error');
};
}
}

0 comments on commit bf66715

Please sign in to comment.