From aad9ffc2c02ccce9098558503e130e4cc9fc35b3 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 22 Apr 2025 13:45:47 +0500 Subject: feat: CLIENT_REQUIRES_JSON constant, json_response and clamp method --- src/utils.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/utils.php') diff --git a/src/utils.php b/src/utils.php index 4954580..325603b 100644 --- a/src/utils.php +++ b/src/utils.php @@ -1,4 +1,13 @@ 1 ? "s" : ""); } +} +function clamp(int $current, int $min, int $max): int +{ + return max($min, min($max, $current)); } \ No newline at end of file -- cgit v1.2.3