Skip to content

Commit 6b18fb0

Browse files
Fixed implicit float->int conversion deprecated warning
1 parent 16f1f3b commit 6b18fb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Generators/NanoIdGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(int $size = null, string $alphabet = null)
3131
public function generate(): string
3232
{
3333
$len = strlen($this->alphabet);
34-
$mask = (2 << log($len - 1) / M_LN2) - 1;
34+
$mask = (2 << (int) (log($len - 1) / M_LN2)) - 1;
3535
$step = (int) ceil(1.6 * $mask * $this->size / $len);
3636
$id = '';
3737
while (true) {

0 commit comments

Comments
 (0)