diff --git a/composer.json b/composer.json index a5b3ba63..d9175785 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "roadrunner-php/roadrunner-api-dto": "^1.4", "roadrunner-php/version-checker": "^1.0", "spiral/attributes": "^3.1.4", - "spiral/roadrunner": "^v2023.2", + "spiral/roadrunner": "^v2023.3.11", "spiral/roadrunner-cli": "^2.5", "spiral/roadrunner-kv": "^4.0", "spiral/roadrunner-worker": "^3.0", diff --git a/src/Internal/Declaration/Reader/WorkflowReader.php b/src/Internal/Declaration/Reader/WorkflowReader.php index ffd59006..04f47232 100644 --- a/src/Internal/Declaration/Reader/WorkflowReader.php +++ b/src/Internal/Declaration/Reader/WorkflowReader.php @@ -158,7 +158,7 @@ private function withSignalsAndQueries(ClassNode $graph, WorkflowPrototype $prot ); } - $prototype->addValidateUpdateHandler($validate->name, $ctx); + $prototype->addValidateUpdateHandler($validate->forUpdate, $ctx); } /** @var SignalMethod|null $signal */ diff --git a/src/Workflow/UpdateValidatorMethod.php b/src/Workflow/UpdateValidatorMethod.php index 9392869c..f8d0f3d9 100644 --- a/src/Workflow/UpdateValidatorMethod.php +++ b/src/Workflow/UpdateValidatorMethod.php @@ -28,13 +28,13 @@ final class UpdateValidatorMethod { /** - * @param non-empty-string $name Name of the update handler the validator should be used for. + * @param non-empty-string $forUpdate Name of the update handler the validator should be used for. * Be careful about names that contain special characters. These names can be used as metric tags. * And systems like prometheus ignore metrics which have tags with unsupported characters. */ public function __construct( #[Immutable] - public string $name, + public string $forUpdate, ) { } } diff --git a/tests/Fixtures/src/Workflow/UpdateWorkflow.php b/tests/Fixtures/src/Workflow/UpdateWorkflow.php index 535098ea..687f33a7 100644 --- a/tests/Fixtures/src/Workflow/UpdateWorkflow.php +++ b/tests/Fixtures/src/Workflow/UpdateWorkflow.php @@ -42,7 +42,7 @@ public function addName(string $name): mixed return $this->greetings; } - #[Workflow\UpdateValidatorMethod(name: 'addName')] + #[Workflow\UpdateValidatorMethod(forUpdate: 'addName')] public function validateName(string $name): void { if (\preg_match('/\\d/', $name) === 1) {