From 6b18fb016f0ff98a89d74898014d5d0de08c6b16 Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:59:07 +0300 Subject: [PATCH] Fixed implicit float->int conversion deprecated warning --- Generators/NanoIdGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Generators/NanoIdGenerator.php b/Generators/NanoIdGenerator.php index f15b06b..b4429ea 100644 --- a/Generators/NanoIdGenerator.php +++ b/Generators/NanoIdGenerator.php @@ -31,7 +31,7 @@ public function __construct(int $size = null, string $alphabet = null) public function generate(): string { $len = strlen($this->alphabet); - $mask = (2 << log($len - 1) / M_LN2) - 1; + $mask = (2 << (int) (log($len - 1) / M_LN2)) - 1; $step = (int) ceil(1.6 * $mask * $this->size / $len); $id = ''; while (true) {