From dd107ef238438e1aff7922449fc0239765b8fdee Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Fri, 19 Apr 2024 09:56:25 -0400 Subject: [PATCH] Improve return type of UserEntityInterface::getId(). (#3599) --- module/VuFind/src/VuFind/Db/Entity/UserEntityInterface.php | 6 +++--- module/VuFind/src/VuFind/Db/Row/User.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/VuFind/src/VuFind/Db/Entity/UserEntityInterface.php b/module/VuFind/src/VuFind/Db/Entity/UserEntityInterface.php index 80d6dd1b7b7..fbb1cd14d08 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserEntityInterface.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserEntityInterface.php @@ -41,11 +41,11 @@ interface UserEntityInterface extends EntityInterface { /** - * Get identifier. + * Get identifier (returns null for an uninitialized or non-persisted object). * - * @return int + * @return ?int */ - public function getId(); + public function getId(): ?int; /** * Username setter diff --git a/module/VuFind/src/VuFind/Db/Row/User.php b/module/VuFind/src/VuFind/Db/Row/User.php index a63bd782070..fddee09ce81 100644 --- a/module/VuFind/src/VuFind/Db/Row/User.php +++ b/module/VuFind/src/VuFind/Db/Row/User.php @@ -789,11 +789,11 @@ public function getLoginTokens(string $userId): array } /** - * Get identifier. + * Get identifier (returns null for an uninitialized or non-persisted object). * - * @return int + * @return ?int */ - public function getId() + public function getId(): ?int { return $this->id; }