From 1f558442d9a062010e6bbf68bda2c03780efd478 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 18 Dec 2023 10:18:40 +0000 Subject: [PATCH] linter fix --- app/controllers/api/account.php | 2 +- src/Appwrite/Hooks/Hooks.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 17d9f47f35..df7d40134d 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -119,7 +119,7 @@ App::post('/v1/account') } } - $hooks->trigger('passwordValidator', [$project, $password, $user]); + $hooks->trigger('passwordValidator', [$project, $password, $user]); $passwordHistory = $project->getAttribute('auths', [])['passwordHistory'] ?? 0; $password = Auth::passwordHash($password, Auth::DEFAULT_ALGO, Auth::DEFAULT_ALGO_OPTIONS); diff --git a/src/Appwrite/Hooks/Hooks.php b/src/Appwrite/Hooks/Hooks.php index ce462eb677..afd112957c 100644 --- a/src/Appwrite/Hooks/Hooks.php +++ b/src/Appwrite/Hooks/Hooks.php @@ -9,16 +9,18 @@ class Hooks */ static array $hooks = []; - public static function add(string $name, callable $action) { + public static function add(string $name, callable $action) + { self::$hooks[$name] = $action; } /** * @param mixed[] $params */ - public function trigger(string $name, array $params = []) { + public function trigger(string $name, array $params = []) + { if (isset(self::$hooks[$name])) { call_user_func_array(self::$hooks[$name], $params); } - } + } }