Skip to content

Commit

Permalink
Fixed implicit float->int conversion deprecated warning
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Apr 24, 2024
1 parent 16f1f3b commit 6b18fb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Generators/NanoIdGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6b18fb0

Please sign in to comment.