From 364d3713812c7be6399558320b44b1c93038c994 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Wed, 13 Sep 2023 14:53:32 +0300 Subject: [PATCH] Change payload type from array to mixed --- src/Scaffolder/src/Declaration/JobHandlerDeclaration.php | 2 +- src/Scaffolder/tests/Command/JobHandlerTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Scaffolder/src/Declaration/JobHandlerDeclaration.php b/src/Scaffolder/src/Declaration/JobHandlerDeclaration.php index 575a3ee19..645ecd493 100644 --- a/src/Scaffolder/src/Declaration/JobHandlerDeclaration.php +++ b/src/Scaffolder/src/Declaration/JobHandlerDeclaration.php @@ -25,7 +25,7 @@ public function declare(): void ->setType('string'); $method->addParameter('payload') - ->setType('array'); + ->setType('mixed'); $method->addParameter('headers') ->setType('array'); diff --git a/src/Scaffolder/tests/Command/JobHandlerTest.php b/src/Scaffolder/tests/Command/JobHandlerTest.php index e3cd28d4d..1562ab0c8 100644 --- a/src/Scaffolder/tests/Command/JobHandlerTest.php +++ b/src/Scaffolder/tests/Command/JobHandlerTest.php @@ -32,6 +32,7 @@ public function testScaffold(): void $this->assertStringContainsString('strict_types=1', $content); $this->assertStringContainsString('{project-name}', $content); $this->assertStringContainsString('@author {author-name}', $content); + $this->assertStringContainsString('function invoke(string $id, mixed $payload, array $headers)', $content); $this->assertStringContainsString('Sample Job Handler', $reflection->getDocComment()); $this->assertTrue($reflection->hasMethod('invoke')); }