Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/LockEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
{
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}
}
}