workflowStorage = $workflowStorage; } public function handle(Request $request): Response { $workflowId = $request->getParam('id'); if (!is_int($workflowId)) { throw InvalidStateException::create(); } $existingWorkflow = $this->workflowStorage->getWorkflow($workflowId); if (!$existingWorkflow instanceof Workflow) { throw InvalidStateException::create(); } $this->workflowStorage->deleteWorkflow($existingWorkflow); return new Response(null); } public static function getRequestSchema(): array { return [ 'id' => Builder::integer()->required(), ]; } }