Skip to content

Commit

Permalink
Use static as return type in db entity interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Sep 4, 2024
1 parent 0b56f8f commit 74aec1a
Show file tree
Hide file tree
Showing 40 changed files with 474 additions and 474 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ interface AccessTokenEntityInterface extends EntityInterface
*
* @param ?UserEntityInterface $user User owning token
*
* @return AccessTokenEntityInterface
* @return static
*/
public function setUser(?UserEntityInterface $user): AccessTokenEntityInterface;
public function setUser(?UserEntityInterface $user): static;

/**
* Set data.
*
* @param string $data Data
*
* @return AccessTokenEntityInterface
* @return static
*/
public function setData(string $data): AccessTokenEntityInterface;
public function setData(string $data): static;

/**
* Is the access token revoked?
Expand All @@ -70,7 +70,7 @@ public function isRevoked(): bool;
*
* @param bool $revoked Revoked
*
* @return AccessTokenEntityInterface
* @return static
*/
public function setRevoked(bool $revoked): AccessTokenEntityInterface;
public function setRevoked(bool $revoked): static;
}
20 changes: 10 additions & 10 deletions module/VuFind/src/VuFind/Db/Entity/AuthHashEntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function getSessionId(): ?string;
*
* @param ?string $sessionId PHP Session id string
*
* @return AuthHashEntityInterface
* @return static
*/
public function setSessionId(?string $sessionId): AuthHashEntityInterface;
public function setSessionId(?string $sessionId): static;

/**
* Get hash value.
Expand All @@ -77,9 +77,9 @@ public function getHash(): string;
*
* @param string $hash Hash Value
*
* @return AuthHashEntityInterface
* @return static
*/
public function setHash(string $hash): AuthHashEntityInterface;
public function setHash(string $hash): static;

/**
* Get type of hash.
Expand All @@ -93,9 +93,9 @@ public function getHashType(): ?string;
*
* @param ?string $type Hash Type
*
* @return AuthHashEntityInterface
* @return static
*/
public function setHashType(?string $type): AuthHashEntityInterface;
public function setHashType(?string $type): static;

/**
* Get data.
Expand All @@ -109,9 +109,9 @@ public function getData(): ?string;
*
* @param ?string $data Data
*
* @return AuthHashEntityInterface
* @return static
*/
public function setData(?string $data): AuthHashEntityInterface;
public function setData(?string $data): static;

/**
* Get created date.
Expand All @@ -125,7 +125,7 @@ public function getCreated(): DateTime;
*
* @param DateTime $dateTime Created date
*
* @return AuthHashEntityInterface
* @return static
*/
public function setCreated(DateTime $dateTime): AuthHashEntityInterface;
public function setCreated(DateTime $dateTime): static;
}
24 changes: 12 additions & 12 deletions module/VuFind/src/VuFind/Db/Entity/ChangeTrackerEntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ interface ChangeTrackerEntityInterface extends EntityInterface
*
* @param string $id Id
*
* @return ChangeTrackerEntityInterface
* @return static
*/
public function setId(string $id): ChangeTrackerEntityInterface;
public function setId(string $id): static;

/**
* Getter for identifier.
Expand All @@ -63,9 +63,9 @@ public function getId(): string;
*
* @param string $name Index name
*
* @return ChangeTrackerEntityInterface
* @return static
*/
public function setIndexName(string $name): ChangeTrackerEntityInterface;
public function setIndexName(string $name): static;

/**
* Getter for index name (formerly core).
Expand All @@ -79,9 +79,9 @@ public function getIndexName(): string;
*
* @param ?DateTime $dateTime Time first added to index.
*
* @return ChangeTrackerEntityInterface
* @return static
*/
public function setFirstIndexed(?DateTime $dateTime): ChangeTrackerEntityInterface;
public function setFirstIndexed(?DateTime $dateTime): static;

/**
* FirstIndexed getter.
Expand All @@ -95,9 +95,9 @@ public function getFirstIndexed(): ?DateTime;
*
* @param ?DateTime $dateTime Last time changed in index.
*
* @return ChangeTrackerEntityInterface
* @return static
*/
public function setLastIndexed(?DateTime $dateTime): ChangeTrackerEntityInterface;
public function setLastIndexed(?DateTime $dateTime): static;

/**
* LastIndexed getter.
Expand All @@ -111,9 +111,9 @@ public function getLastIndexed(): ?DateTime;
*
* @param ?DateTime $dateTime Last time original record was edited
*
* @return ChangeTrackerEntityInterface
* @return static
*/
public function setLastRecordChange(?DateTime $dateTime): ChangeTrackerEntityInterface;
public function setLastRecordChange(?DateTime $dateTime): static;

/**
* LastRecordChange getter.
Expand All @@ -127,9 +127,9 @@ public function getLastRecordChange(): ?DateTime;
*
* @param ?DateTime $dateTime Time record was removed from index
*
* @return ChangeTrackerEntityInterface
* @return static
*/
public function setDeleted(?DateTime $dateTime): ChangeTrackerEntityInterface;
public function setDeleted(?DateTime $dateTime): static;

/**
* Deleted getter.
Expand Down
16 changes: 8 additions & 8 deletions module/VuFind/src/VuFind/Db/Entity/CommentsEntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public function getId(): int;
*
* @param string $comment Comment
*
* @return Comments
* @return static
*/
public function setComment(string $comment): CommentsEntityInterface;
public function setComment(string $comment): static;

/**
* Comment getter
Expand All @@ -70,9 +70,9 @@ public function getComment(): string;
*
* @param DateTime $dateTime Created date
*
* @return Comments
* @return static
*/
public function setCreated(DateTime $dateTime): CommentsEntityInterface;
public function setCreated(DateTime $dateTime): static;

/**
* Created getter
Expand All @@ -86,9 +86,9 @@ public function getCreated(): DateTime;
*
* @param ?UserEntityInterface $user User that created comment
*
* @return Comments
* @return static
*/
public function setUser(?UserEntityInterface $user): CommentsEntityInterface;
public function setUser(?UserEntityInterface $user): static;

/**
* User getter
Expand All @@ -102,7 +102,7 @@ public function getUser(): ?UserEntityInterface;
*
* @param ResourceEntityInterface $resource Resource id.
*
* @return Comments
* @return static
*/
public function setResource(ResourceEntityInterface $resource): CommentsEntityInterface;
public function setResource(ResourceEntityInterface $resource): static;
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function getSessionId(): string;
*
* @param string $sessionId PHP session id string
*
* @return ExternalSessionEntityInterface
* @return static
*/
public function setSessionId(string $sessionId): ExternalSessionEntityInterface;
public function setSessionId(string $sessionId): static;

/**
* Get external session id string.
Expand All @@ -77,9 +77,9 @@ public function getExternalSessionId(): string;
*
* @param string $externalSessionId External session id string
*
* @return ExternalSessionEntityInterface
* @return static
*/
public function setExternalSessionId(string $externalSessionId): ExternalSessionEntityInterface;
public function setExternalSessionId(string $externalSessionId): static;

/**
* Get created date.
Expand All @@ -93,7 +93,7 @@ public function getCreated(): DateTime;
*
* @param DateTime $dateTime Created date
*
* @return ExternalSessionEntityInterface
* @return static
*/
public function setCreated(DateTime $dateTime): ExternalSessionEntityInterface;
public function setCreated(DateTime $dateTime): static;
}
36 changes: 18 additions & 18 deletions module/VuFind/src/VuFind/Db/Entity/FeedbackEntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public function getId(): int;
*
* @param string $message Message
*
* @return FeedbackEntityInterface
* @return static
*/
public function setMessage(string $message): FeedbackEntityInterface;
public function setMessage(string $message): static;

/**
* Message getter
Expand All @@ -70,9 +70,9 @@ public function getMessage(): string;
*
* @param array $data Form data
*
* @return FeedbackEntityInterface
* @return static
*/
public function setFormData(array $data): FeedbackEntityInterface;
public function setFormData(array $data): static;

/**
* Form data getter
Expand All @@ -86,9 +86,9 @@ public function getFormData(): array;
*
* @param string $name Form name
*
* @return FeedbackEntityInterface
* @return static
*/
public function setFormName(string $name): FeedbackEntityInterface;
public function setFormName(string $name): static;

/**
* Form name getter
Expand All @@ -102,9 +102,9 @@ public function getFormName(): string;
*
* @param DateTime $dateTime Created date
*
* @return FeedbackEntityInterface
* @return static
*/
public function setCreated(DateTime $dateTime): FeedbackEntityInterface;
public function setCreated(DateTime $dateTime): static;

/**
* Created getter
Expand All @@ -118,9 +118,9 @@ public function getCreated(): DateTime;
*
* @param DateTime $dateTime Last update date
*
* @return FeedbackEntityInterface
* @return static
*/
public function setUpdated(DateTime $dateTime): FeedbackEntityInterface;
public function setUpdated(DateTime $dateTime): static;

/**
* Updated getter
Expand All @@ -134,9 +134,9 @@ public function getUpdated(): DateTime;
*
* @param string $status Status
*
* @return FeedbackEntityInterface
* @return static
*/
public function setStatus(string $status): FeedbackEntityInterface;
public function setStatus(string $status): static;

/**
* Status getter
Expand All @@ -150,9 +150,9 @@ public function getStatus(): string;
*
* @param string $url Site URL
*
* @return FeedbackEntityInterface
* @return static
*/
public function setSiteUrl(string $url): FeedbackEntityInterface;
public function setSiteUrl(string $url): static;

/**
* Site URL getter
Expand All @@ -166,9 +166,9 @@ public function getSiteUrl(): string;
*
* @param ?UserEntityInterface $user User that created request
*
* @return FeedbackEntityInterface
* @return static
*/
public function setUser(?UserEntityInterface $user): FeedbackEntityInterface;
public function setUser(?UserEntityInterface $user): static;

/**
* User getter
Expand All @@ -182,9 +182,9 @@ public function getUser(): ?UserEntityInterface;
*
* @param ?UserEntityInterface $user User that updated request
*
* @return FeedbackEntityInterface
* @return static
*/
public function setUpdatedBy(?UserEntityInterface $user): FeedbackEntityInterface;
public function setUpdatedBy(?UserEntityInterface $user): static;

/**
* Updatedby getter
Expand Down
Loading

0 comments on commit 74aec1a

Please sign in to comment.