diff --git a/lib/Db/EntityWithUser.php b/lib/Db/EntityWithUser.php index 8ca56359d..426f65d86 100644 --- a/lib/Db/EntityWithUser.php +++ b/lib/Db/EntityWithUser.php @@ -49,10 +49,6 @@ public function getDisplayName(): ?string { return $this->displayName; } - // if (!$this->getUserId()) { - // return 'No UserId'; - // } - return Container::queryClass(IUserManager::class)->get($this->getUserId())?->getDisplayName() ?? 'Deleted User'; } diff --git a/lib/Db/Option.php b/lib/Db/Option.php index 651c8d46e..f00999059 100644 --- a/lib/Db/Option.php +++ b/lib/Db/Option.php @@ -163,7 +163,6 @@ public function getIsLocked(): bool { */ public function getIsLockedByOptionLimit(): bool { return $this->getOptionLimit() && $this->getVotesYes() >= $this->getOptionLimit() && $this->getUserVoteAnswer() !== Vote::VOTE_YES; - // return $this->getOptionLimit() && !$this->getUserVote() === Vote::VOTE_YES && $this->getVotesYes() >= $this->getOptionLimit() ; } public function getIsLockedByVotesLimit(): bool { @@ -172,7 +171,6 @@ public function getIsLockedByVotesLimit(): bool { // AND the count of yes votes of the current user is EQUAL OR GREATER THAN the vote limit // return true (locked option) return $this->getVoteLimit() && $this->getUserCountYesVotes() >= $this->getVoteLimit(); - // return $this->getVoteLimit() && !$this->getUserVote() === Vote::VOTE_YES && $this->getUserCountYesVotes() >= $this->getVoteLimit(); } public function getOrder(): int { @@ -225,10 +223,6 @@ public function getDateStringLocalized(DateTimeZone $timeZone, IL10N $l10n): str return (string) $dateTimeFrom . ' - ' . (string) $dateTimeTo; } - // private function getOwnerIsNoUser(): bool { - // return !$this->userManager->get($this->getOwner()) instanceof IUser; - // } - /** * Check, if the date option spans one or more whole days (from 00:00 to 24:00) */ diff --git a/lib/Db/ShareMapper.php b/lib/Db/ShareMapper.php index 0dd2e242c..1e76ff25c 100644 --- a/lib/Db/ShareMapper.php +++ b/lib/Db/ShareMapper.php @@ -55,15 +55,6 @@ public function __construct( public function findByPoll(int $pollId): array { $qb = $this->db->getQueryBuilder(); - // Build the following select (MySQL) - // - // SELECT *, COUNT(votes.user_id) as voted - // FROM oc_polls_share shares - // LEFT JOIN oc_polls_votes votes - // ON shares.poll_id = votes.poll_id AND shares.user_id = votes.user_id - // WHERE shares.poll_id = $pollId - // GROUP BY shares.id - // $qb->select('shares.*') ->from($this->getTableName(), 'shares') diff --git a/lib/Db/TableManager.php b/lib/Db/TableManager.php index 266e55a7b..3bb40309b 100644 --- a/lib/Db/TableManager.php +++ b/lib/Db/TableManager.php @@ -103,7 +103,6 @@ public function purgeTables(): array { $messages[] = 'Removed all migration records from ' . $this->dbPrefix . 'migrations'; // delete all app configs - // $query = $this->connection->getQueryBuilder(); $query->delete('appconfig') ->where('appid = :appid') ->setParameter('appid', AppConstants::APP_ID) @@ -219,7 +218,6 @@ public function removeObsoleteTables(): array { $messages = []; foreach (TableSchema::GONE_TABLES as $tableName) { - // $tableName = $this->dbPrefix . $tableName; if ($this->connection->tableExists($tableName)) { $dropped = true; $this->connection->dropTable($tableName); diff --git a/lib/Db/UserMapper.php b/lib/Db/UserMapper.php index a5c74ac14..30466a383 100644 --- a/lib/Db/UserMapper.php +++ b/lib/Db/UserMapper.php @@ -91,7 +91,7 @@ public function getCurrentUserId(): string { */ public function getCurrentUser(): UserBase { if ($this->currentUser) { - // if already lodaed, return user + // if already loaded, return user return $this->currentUser; } diff --git a/lib/Model/Acl.php b/lib/Model/Acl.php index 4fc200659..7eda2c207 100644 --- a/lib/Model/Acl.php +++ b/lib/Model/Acl.php @@ -203,7 +203,6 @@ public function getUserId(): string { private function getDisplayName(): string { return $this->userMapper->getCurrentUser()->getDisplayName(); - // return ($this->getIsLoggedIn() ? $this->userManager->get($this->getUserId())?->getDisplayName() : $this->share->getDisplayName()) ?? ''; } /** diff --git a/lib/Model/Mail/ConfirmationMail.php b/lib/Model/Mail/ConfirmationMail.php index 48d76f3e2..454648ceb 100644 --- a/lib/Model/Mail/ConfirmationMail.php +++ b/lib/Model/Mail/ConfirmationMail.php @@ -77,10 +77,6 @@ protected function buildBody(): void { ); } - // $this->emailTemplate->addBodyText( - // $this->l10n->t('Used languageCode is %1$s, %2$s, %3$s', [$this->l10n->getLanguageCode(), $this->l10n->getLocaleCode(), $this->transFactory->localeExists($this->l10n->getLanguageCode())]) - // ); - if ($this->poll->getDescription()) { $this->emailTemplate->addBodyText($this->getRichDescription(), $this->poll->getDescription()); } diff --git a/lib/Model/UserBase.php b/lib/Model/UserBase.php index de8047a77..0097d3397 100644 --- a/lib/Model/UserBase.php +++ b/lib/Model/UserBase.php @@ -133,13 +133,11 @@ public function getIcon(): string { } public function getEmailAddress(): string { - // return $this->emailAddress; return $this->emailAddress ?? ''; } // Function for obfuscating mail adresses; Default return the email address public function getEmailAddressMasked(): string { - // return $this->emailAddress; return $this->emailAddress ?? ''; } diff --git a/lib/Service/PollService.php b/lib/Service/PollService.php index 0f052114f..d3597ed4d 100644 --- a/lib/Service/PollService.php +++ b/lib/Service/PollService.php @@ -256,8 +256,6 @@ public function add(string $type, string $title): Poll { * @return Poll */ public function update(int $pollId, array $poll): Poll { - // $this->acl->setPollId($pollId, Acl::PERMISSION_POLL_EDIT); - // $this->poll = $this->acl->getPoll(); $this->poll = $this->pollMapper->find($pollId); // Validate valuess