diff --git a/psalm.xml b/psalm.xml
index e1f086b..7e98f69 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -13,14 +13,4 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Lock.php b/src/Lock.php
index bd03f6c..b3a9cff 100644
--- a/src/Lock.php
+++ b/src/Lock.php
@@ -41,6 +41,7 @@ public function __construct(
*
* @throws \InvalidArgumentException If ttl is negative.
*/
+ #[\Override]
public function lock(
string $resource,
?string $id = null,
@@ -78,6 +79,7 @@ public function lock(
*
* @throws \InvalidArgumentException If ttl is negative.
*/
+ #[\Override]
public function lockRead(
string $resource,
?string $id = null,
@@ -105,6 +107,7 @@ public function lockRead(
* @param non-empty-string $id Lock ID from lock or lockRead method.
* @return bool Returns true if the lock was released successfully, false otherwise.
*/
+ #[\Override]
public function release(string $resource, string $id): bool
{
$request = new Request();
@@ -126,6 +129,7 @@ public function release(string $resource, string $id): bool
* @param non-empty-string $resource The name of the resource to be unlocked
* @return bool Returns true if all locks were released successfully, false otherwise
*/
+ #[\Override]
public function forceRelease(string $resource): bool
{
$request = new Request();
@@ -145,6 +149,7 @@ public function forceRelease(string $resource): bool
* @param string|null $id Lock ID from lock or lockRead method.
* @return bool Returns true if the resource is locked, false otherwise.
*/
+ #[\Override]
public function exists(string $resource, ?string $id = null): bool
{
$request = new Request();
@@ -166,6 +171,7 @@ public function exists(string $resource, ?string $id = null): bool
*
* @throws \InvalidArgumentException If ttl is negative.
*/
+ #[\Override]
public function updateTTL(string $resource, string $id, int|float|\DateInterval $ttl): bool
{
$request = new Request();
@@ -181,12 +187,12 @@ public function updateTTL(string $resource, string $id, int|float|\DateInterval
private function convertTimeToMicroseconds(int|float|\DateInterval $ttl): int
{
if ($ttl instanceof \DateInterval) {
- return (int) \round((int) $ttl->format('%s') * 1_000_000);
+ return (int) $ttl->format('%s') * 1_000_000;
}
\assert($ttl >= 0, 'TTL must be positive');
- return (int) \round($ttl * 1_000_000);
+ return (int) \round((float) $ttl * 1_000_000.0);
}
/**
diff --git a/src/UuidLockIdGenerator.php b/src/UuidLockIdGenerator.php
index 8ee41f7..e8577c5 100644
--- a/src/UuidLockIdGenerator.php
+++ b/src/UuidLockIdGenerator.php
@@ -13,6 +13,7 @@ public function __construct(
private readonly UuidFactoryInterface $factory = new UuidFactory(),
) {}
+ #[\Override]
public function generate(): string
{
return $this->factory->uuid4()->toString();