Skip to content

Commit

Permalink
Merge pull request #297 from rshkabko/patch-1
Browse files Browse the repository at this point in the history
ShortURL::max('id') alway integer
  • Loading branch information
ash-jc-allen authored Sep 17, 2024
2 parents e2f72d3 + fefd482 commit 3ed0c2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Classes/KeyGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public function generateKeyUsing(int $seed = null): string
/**
* Get the ID of the last inserted ShortURL. This is done so that we can predict
* what the ID of the ShortURL that will be inserted will be called. From doing
* this, we can create a unique hash without a reduced chance of a collision.
* this, we can create a unique hash with a reduced chance of a collision.
*/
protected function getLastInsertedID(): int
{
return ShortURL::max('id') ?? 0;
return (int) ShortURL::max('id');
}
}

0 comments on commit 3ed0c2d

Please sign in to comment.