Completed
Pull Request — master (#695)
by René
05:02
created
lib/Service/MailService.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
lib/Controller/ShareController.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
lib/Controller/PollController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
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 = [];
Please login to merge, or discard this patch.
lib/Migration/Version0010Date20191227063812.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -263,8 +263,8 @@
 block discarded – undo
263 263
 	}
264 264
 
265 265
 	/**
266
-	* Copy public tokens
267
-	*/
266
+	 * Copy public tokens
267
+	 */
268 268
 	protected function migrateEvents() {
269 269
 		$insert = $this->connection->getQueryBuilder();
270 270
 		$insert
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -299,7 +299,7 @@
 block discarded – undo
299 299
 			->setParameter('expire', intval(strtotime($row['expire'])))
300 300
 			->setParameter('deleted', intval(strtotime($row['deleted'])))
301 301
 			->setParameter('access', $this->resolveAccess($row['access']))
302
-			->setParameter('anonymous', intval( $row['full_anonymous'] ) * 2 + intval($row['is_anonymous']))
302
+			->setParameter('anonymous', intval($row['full_anonymous']) * 2 + intval($row['is_anonymous']))
303 303
 			->setParameter('full_anonymous', $row['full_anonymous'])
304 304
 			->setParameter('allow_maybe', $row['allow_maybe'])
305 305
 			->setParameter('options', $this->resolveOptions($row['allow_maybe']));
Please login to merge, or discard this patch.
lib/Model/Acl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
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
 			})
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 	 * @return bool
253 253
 	 */
254 254
 	public function getAllowSeeUsernames(): bool {
255
-		return !(($this->poll->getAnonymous() && !$this->getIsOwner()) || $this->poll->getFullAnonymous());;
255
+		return !(($this->poll->getAnonymous() && !$this->getIsOwner()) || $this->poll->getFullAnonymous()); ;
256 256
 	}
257 257
 
258 258
 	/**
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 			$this->foundByToken = true;
297 297
 			$this->setPollId($share->getPollId());
298 298
 
299
-			if (($share->getType() === 'group' || $share->getType() === 'user')  && !\OC::$server->getUserSession()->isLoggedIn()) {
299
+			if (($share->getType() === 'group' || $share->getType() === 'user') && !\OC::$server->getUserSession()->isLoggedIn()) {
300 300
 				// User must be logged in for shareType user and group
301 301
 				$this->setPollId(0);
302 302
 				$this->setUserId(null);
Please login to merge, or discard this patch.