$inputs the list of inputs in which the value at {@see $key} should be checked * @param string $key the key in {@see $inputs} of the input to check * @return void if the checked input equals the CLI secret * @throws InvalidInputException if the checked input is not set, the CLI secret is a blank string, the CLI secret * is at its default value, or if the checked input does not equal the CLI secret */ public function check(array $inputs, string $key): void { $cli_password = Config::get()["admin"]["cli_secret"]; if (trim($cli_password) === "" || $cli_password === self::CLI_SECRET_DEFAULT) throw new InvalidInputException( $this->override_message ?? "The CLI is disabled because the CLI secret is not set.", $key ); if (!isset($inputs[$key]) || !password_verify($inputs[$key], Config::get()["admin"]["cli_secret"])) throw new InvalidInputException($this->override_message ?? "Incorrect password.", $key); } }