|
9 | 9 | use NeuronAI\Tests\Workflow\Stubs\NodeThree; |
10 | 10 | use NeuronAI\Tests\Workflow\Stubs\NodeTwo; |
11 | 11 | use NeuronAI\Workflow\Events\Event; |
| 12 | +use NeuronAI\Workflow\NodeInterface; |
12 | 13 | use NeuronAI\Workflow\Workflow; |
| 14 | +use NeuronAI\Workflow\WorkflowState; |
13 | 15 | use PHPUnit\Framework\TestCase; |
14 | 16 |
|
15 | 17 | class GlobalMiddlewareMethodTest extends TestCase |
@@ -218,7 +220,7 @@ protected function globalMiddleware(): array |
218 | 220 | public function testGlobalMiddlewareOverrideCanReadAndWriteState(): void |
219 | 221 | { |
220 | 222 | $middleware = FakeMiddleware::make() |
221 | | - ->setBeforeHandler(function ($node, $event, $state): void { |
| 223 | + ->setBeforeHandler(function (NodeInterface $node, Event $event, WorkflowState $state): void { |
222 | 224 | $state->set('injected_by_global', true); |
223 | 225 | $state->set('execution_count', ($state->get('execution_count') ?? 0) + 1); |
224 | 226 | }); |
@@ -250,7 +252,7 @@ protected function globalMiddleware(): array |
250 | 252 | public function testEmptyGlobalMiddlewareOverrideDoesNotCauseErrors(): void |
251 | 253 | { |
252 | 254 | // A workflow that explicitly returns empty array should work fine |
253 | | - $workflow = new class extends Workflow { |
| 255 | + $workflow = new class () extends Workflow { |
254 | 256 | protected function nodes(): array |
255 | 257 | { |
256 | 258 | return [new NodeOne(), new NodeTwo(), new NodeThree()]; |
|
0 commit comments