diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index 69d36ba..fb9e37e 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -137,7 +137,7 @@ class UserRepository } - public function update(User $user): bool|int + public function update(User $user): bool { $id = $user->getId(); $nick = $user->getNick(); @@ -169,9 +169,7 @@ class UserRepository $statement->bindParam(param: 'first', var: $first); $statement->bindParam(param: 'last', var: $last); $statement->bindParam(param: 'is_admin', var: $isAdmin); - $statement->execute(); - - return $statement->rowCount(); + return $statement->execute(); } catch (PDOException $e) { echo $e->getMessage(); return false; @@ -179,7 +177,7 @@ class UserRepository } - public function delete(User $user): int + public function delete(User $user): bool { $sql = " DELETE FROM " . DatabaseConnection::TABLE_USERS . " @@ -189,9 +187,7 @@ class UserRepository $statement = $this->databaseConnection->getConnection()->prepare(query: $sql); $id = $user->getId(); $statement->bindParam(param: 'id', var: $id); - $statement->execute(); - - return $statement->rowCount(); + return $statement->execute(); } catch (PDOException $e) { exit($e->getMessage()); }