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 5c64f6e commit a550ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Support/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 a550ae6

Please sign in to comment.