[new IsEmailRule()], "password" => [new HasLengthRule(UserManager::MIN_PASSWORD_LENGTH, UserManager::MAX_PASSWORD_LENGTH)], ], ); $this->user_manager = $user_manager; } function handle(): mixed { $response = $this->user_manager->register_user($_POST["email"], $_POST["password"]); if (!$response->satisfied) throw new ActionException($response->payload["message"], $response->payload["target"]); return $response->payload; } }