diff --git a/src/LockEntry.php b/src/LockEntry.php index d705163..c106108 100644 --- a/src/LockEntry.php +++ b/src/LockEntry.php @@ -13,11 +13,11 @@ class LockEntry implements \JsonSerializable { /** * @param stdClass $lockEntry - * @return LockEntry + * @return static */ - public static function fromObject(stdClass $lockEntry): LockEntry + public static function fromObject(stdClass $lockEntry): static { - return new LockEntry( + return new static( $lockEntry->by ?? null, $lockEntry->until ?? null, $lockEntry->exclusive ?? null @@ -26,7 +26,7 @@ public static function fromObject(stdClass $lockEntry): LockEntry /** * @param string $json - * @return LockEntry[] + * @return static[] */ public static function fromJson(string $json): array { @@ -124,9 +124,9 @@ public function isExclusive(): ?bool /** * @param int|null $until - * @return LockEntry + * @return $this */ - public function setUntil(?int $until): LockEntry + public function setUntil(?int $until): static { $this->until = $until; return $this; @@ -136,8 +136,8 @@ public function setUntil(?int $until): LockEntry * @param int $remaining * @return $this */ - public function setRemaining(int $remaining): LockEntry + public function setRemaining(int $remaining): static { return $this->setUntil(time() + $remaining); } -} \ No newline at end of file +}