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); } - } + } }