@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | public function getGroupShare(): bool { |
| 183 | 183 | return count( |
| 184 | 184 | array_filter($this->shareMapper->findByPoll($this->getPollId()), function($item) { |
| 185 | - if ($item->getType() === 'group' && $this->groupManager->isInGroup($this->getUserId(),$item->getUserId())) { |
|
| 185 | + if ($item->getType() === 'group' && $this->groupManager->isInGroup($this->getUserId(), $item->getUserId())) { |
|
| 186 | 186 | return true; |
| 187 | 187 | } |
| 188 | 188 | }) |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | * @return bool |
| 238 | 238 | */ |
| 239 | 239 | public function getAllowSeeUsernames(): bool { |
| 240 | - return !(($this->poll->getIsAnonymous() && !$this->getIsOwner()) || $this->poll->getFullAnonymous());; |
|
| 240 | + return !(($this->poll->getIsAnonymous() && !$this->getIsOwner()) || $this->poll->getFullAnonymous()); ; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /** |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $this->foundByToken = true; |
| 282 | 282 | $this->setPollId($share->getPollId()); |
| 283 | 283 | |
| 284 | - if (($share->getType() === 'group' || $share->getType() === 'user') && !\OC::$server->getUserSession()->isLoggedIn()) { |
|
| 284 | + if (($share->getType() === 'group' || $share->getType() === 'user') && !\OC::$server->getUserSession()->isLoggedIn()) { |
|
| 285 | 285 | // User must be logged in for shareType user and group |
| 286 | 286 | $this->setPollId(0); |
| 287 | 287 | $this->setUserId(null); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | use OCA\Polls\Db\Share; |
| 42 | 42 | use OCA\Polls\Db\LogMapper; |
| 43 | 43 | |
| 44 | -class MailService { |
|
| 44 | +class MailService { |
|
| 45 | 45 | |
| 46 | 46 | private $userManager; |
| 47 | 47 | private $groupManager; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (!$toEmail || !filter_var($toEmail, FILTER_VALIDATE_EMAIL)) { |
| 123 | - throw new Exception( 'Invalid email address (' . $toEmail .')' ); |
|
| 123 | + throw new Exception('Invalid email address (' . $toEmail . ')'); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | try { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $emailTemplate->addBodyText(str_replace( |
| 253 | 253 | ['{owner}', '{title}'], |
| 254 | 254 | [$owner->getDisplayName(), $poll->getTitle()], |
| 255 | - $trans->t('{owner} invited you to take part in the poll "{title}"' ) |
|
| 255 | + $trans->t('{owner} invited you to take part in the poll "{title}"') |
|
| 256 | 256 | )); |
| 257 | 257 | |
| 258 | 258 | $emailTemplate->addBodyButton( |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $recipient['link'] |
| 261 | 261 | ); |
| 262 | 262 | |
| 263 | - $emailTemplate->addFooter($trans->t('This email is sent to you, because you are invited to vote in this poll by the poll owner.' )); |
|
| 263 | + $emailTemplate->addFooter($trans->t('This email is sent to you, because you are invited to vote in this poll by the poll owner.')); |
|
| 264 | 264 | |
| 265 | 265 | try { |
| 266 | 266 | $this->sendMail( |
@@ -325,27 +325,27 @@ discard block |
||
| 325 | 325 | } elseif ($logItem->getMessageId() === 'setVote') { |
| 326 | 326 | $emailTemplate->addBodyText($trans->t( |
| 327 | 327 | '- %s voted.', |
| 328 | - array( $this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 328 | + array($this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 329 | 329 | ); |
| 330 | 330 | } elseif ($logItem->getMessageId() === 'updatePoll') { |
| 331 | 331 | $emailTemplate->addBodyText($trans->t( |
| 332 | 332 | '- %s updated the poll configuration. Please check your votes.', |
| 333 | - array( $this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 333 | + array($this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 334 | 334 | ); |
| 335 | 335 | } elseif ($logItem->getMessageId() === 'deletePoll') { |
| 336 | 336 | $emailTemplate->addBodyText($trans->t( |
| 337 | 337 | '- %s deleted the poll.', |
| 338 | - array( $this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 338 | + array($this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 339 | 339 | ); |
| 340 | 340 | } elseif ($logItem->getMessageId() === 'restorePoll') { |
| 341 | 341 | $emailTemplate->addBodyText($trans->t( |
| 342 | 342 | '- %s restored the poll.', |
| 343 | - array( $this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 343 | + array($this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 344 | 344 | ); |
| 345 | 345 | } elseif ($logItem->getMessageId() === 'expirePoll') { |
| 346 | 346 | $emailTemplate->addBodyText($trans->t( |
| 347 | 347 | '- The poll expired.', |
| 348 | - array( $this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 348 | + array($this->userManager->get($logItem->getUserId())->getDisplayName())) |
|
| 349 | 349 | ); |
| 350 | 350 | } |
| 351 | 351 | |
@@ -360,10 +360,10 @@ discard block |
||
| 360 | 360 | $url, |
| 361 | 361 | /** @scrutinizer ignore-type */ false |
| 362 | 362 | ); |
| 363 | - $emailTemplate->addFooter($trans->t('This email is sent to you, because you subscribed to notifications of this poll. To opt out, visit the poll and remove your subscription.' )); |
|
| 363 | + $emailTemplate->addFooter($trans->t('This email is sent to you, because you subscribed to notifications of this poll. To opt out, visit the poll and remove your subscription.')); |
|
| 364 | 364 | |
| 365 | 365 | try { |
| 366 | - $this->sendMail( $emailTemplate, $subscription->getUserId()); |
|
| 366 | + $this->sendMail($emailTemplate, $subscription->getUserId()); |
|
| 367 | 367 | } catch (Exeption $e) { |
| 368 | 368 | // todo alert Owner |
| 369 | 369 | // Notification to $subscription->getUserId() could not be sent |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | class ShareController extends Controller { |
| 49 | 49 | |
| 50 | - private $logger; |
|
| 51 | - private $acl; |
|
| 50 | + private $logger; |
|
| 51 | + private $acl; |
|
| 52 | 52 | private $mapper; |
| 53 | 53 | private $userId; |
| 54 | 54 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | Acl $acl |
| 81 | 81 | ) { |
| 82 | 82 | parent::__construct($appName, $request); |
| 83 | - $this->logger = $logger; |
|
| 83 | + $this->logger = $logger; |
|
| 84 | 84 | $this->userId = $userId; |
| 85 | 85 | $this->mapper = $mapper; |
| 86 | 86 | $this->pollMapper = $pollMapper; |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | - * getByToken |
|
| 94 | - * Get pollId by token |
|
| 95 | - * @NoAdminRequired |
|
| 96 | - * @NoCSRFRequired |
|
| 97 | - * @PublicPage |
|
| 98 | - * @param string $token |
|
| 99 | - * @return DataResponse |
|
| 100 | - */ |
|
| 93 | + * getByToken |
|
| 94 | + * Get pollId by token |
|
| 95 | + * @NoAdminRequired |
|
| 96 | + * @NoCSRFRequired |
|
| 97 | + * @PublicPage |
|
| 98 | + * @param string $token |
|
| 99 | + * @return DataResponse |
|
| 100 | + */ |
|
| 101 | 101 | public function get($token) { |
| 102 | 102 | try { |
| 103 | 103 | $share = $this->mapper->findByToken($token); |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | } else { |
| 120 | 120 | return false; |
| 121 | 121 | } |
| 122 | - }); |
|
| 122 | + }); |
|
| 123 | 123 | return new DataResponse($polls, Http::STATUS_OK); |
| 124 | 124 | } catch (DoesNotExistException $e) { |
| 125 | 125 | $polls = []; |
@@ -249,7 +249,7 @@ |
||
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | $this->poll->setOwner($this->userId); |
| 252 | - $this->poll->setCreated(date('Y-m-d H:i:s',time())); |
|
| 252 | + $this->poll->setCreated(date('Y-m-d H:i:s', time())); |
|
| 253 | 253 | |
| 254 | 254 | } finally { |
| 255 | 255 | $this->poll->setTitle($poll['title']); |