validator()){ return new JsonResponse(['message' => 'Updating step validation has failed due to missing requirements'], HttpStatus::VALIDATION_FAILED); } (new CompletesOrderStep())->execute($orderId, $step); /** notification */ return new JsonResponse(null, HttpStatus::REQUEST_ACCEPTED); } catch (\Exception $exception){ throw new InternalServerErrorException("Failed to update order step because {$exception->getMessage()}"); } } }