Passed
Pull Request — master (#260)
by Kai
02:32
created
lib/Db/Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,6 +34,6 @@
 block discarded – undo
34 34
 	 * @param $value
35 35
 	 */
36 36
 	public function __set($name, $value) {
37
-		$this->setter($name, [$value]);
37
+		$this->setter($name, [ $value ]);
38 38
 	}
39 39
 }
Please login to merge, or discard this patch.
tests/Unit/Factories/CommentFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
  */
29 29
 $fm->define('OCA\Polls\Db\Comment')->setDefinitions([
30 30
 	'userId' => Faker::firstNameMale(),
31
-	'dt' => function () {
31
+	'dt' => function() {
32 32
 		$date = new DateTime('today');
33 33
 		return $date->format('Y-m-d H:i:s');
34 34
 	},
Please login to merge, or discard this patch.
tests/Unit/Factories/ParticipationFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
  */
29 29
 $fm->define('OCA\Polls\Db\Participation')->setDefinitions([
30 30
 	'userId' => Faker::firstNameMale(),
31
-	'dt' => function () {
31
+	'dt' => function() {
32 32
 		$date = new DateTime('today');
33 33
 		return $date->format('Y-m-d H:i:s');
34 34
 	},
Please login to merge, or discard this patch.
tests/Unit/Factories/DateFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
  * General factory for the date model.
26 26
  */
27 27
 $fm->define('OCA\Polls\Db\Date')->setDefinitions([
28
-	'dt' => function () {
28
+	'dt' => function() {
29 29
 		$date = new DateTime('today');
30 30
 		return $date->format('Y-m-d H:i:s');
31 31
 	}
Please login to merge, or discard this patch.
templates/create.tmpl.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,22 +27,22 @@  discard block
 block discarded – undo
27 27
 	\OCP\Util::addScript('polls', 'create_edit');
28 28
 	\OCP\Util::addScript('polls', 'vendor/jquery.datetimepicker.full.min');
29 29
 
30
-	$userId = $_['userId'];
30
+	$userId = $_[ 'userId' ];
31 31
 	/** @var \OCP\IUserManager $userMgr */
32
-	$userMgr = $_['userMgr'];
32
+	$userMgr = $_[ 'userMgr' ];
33 33
 	/** @var \OCP\IURLGenerator $urlGenerator */
34
-	$urlGenerator = $_['urlGenerator'];
35
-	$isUpdate = isset($_['poll']) && $_['poll'] !== null;
34
+	$urlGenerator = $_[ 'urlGenerator' ];
35
+	$isUpdate = isset($_[ 'poll' ]) && $_[ 'poll' ] !== null;
36 36
 	$isAnonymous = false;
37 37
 	$hideNames = false;
38 38
 
39 39
 	if ($isUpdate) {
40 40
 		/** @var OCA\Polls\Db\Event $poll */
41
-		$poll = $_['poll'];
41
+		$poll = $_[ 'poll' ];
42 42
 		$isAnonymous = $poll->getIsAnonymous();
43 43
 		$hideNames = $isAnonymous && $poll->getFullAnonymous();
44 44
 		/** @var OCA\Polls\Db\Date[]|OCA\Polls\Db\Text[] $dates */
45
-		$dates = $_['dates'];
45
+		$dates = $_[ 'dates' ];
46 46
 		$chosen = '[';
47 47
 		foreach ($dates as $d) {
48 48
 			if ($poll->getType() === 0) {
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		$title = $poll->getTitle();
58 58
 		$desc = $poll->getDescription();
59 59
 		if ($poll->getExpire() !== null) {
60
-			$expireTs = strtotime($poll->getExpire()) - 60*60*24; //remove one day, which has been added to expire at the end of a day
60
+			$expireTs = strtotime($poll->getExpire()) - 60 * 60 * 24; //remove one day, which has been added to expire at the end of a day
61 61
 			$expireStr = date('d.m.Y', $expireTs);
62 62
 		}
63 63
 		$access = $poll->getAccess();
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 							<table id="selected-dates-table" class="choices">
172 172
 							</table>
173 173
 						</div>
174
-						<div id="text-select-container" <?php if(!$isUpdate || $poll->getType() === 0) print_unescaped('style="display:none;"'); ?> >
174
+						<div id="text-select-container" <?php if (!$isUpdate || $poll->getType() === 0) print_unescaped('style="display:none;"'); ?> >
175 175
 							<label for="text-title" class="input_title"><?php p($l->t('Text item')); ?></label>
176 176
 							<div class="input-group">
177 177
 								<input type="text" id="text-title" placeholder="<?php print_unescaped('Insert text...'); ?>" />
Please login to merge, or discard this patch.
lib/Db/ParticipationTextMapper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public function findByPoll($pollId, $limit = null, $offset = null) {
46 46
 		$sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
47
-		return $this->findEntities($sql, [$pollId], $limit, $offset);
47
+		return $this->findEntities($sql, [ $pollId ], $limit, $offset);
48 48
 	}
49 49
 
50 50
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function findDistinctByUser($userId, $limit = null, $offset = null) {
57 57
 		$sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?';
58
-		return $this->findEntities($sql, [$userId], $limit, $offset);
58
+		return $this->findEntities($sql, [ $userId ], $limit, $offset);
59 59
 	}
60 60
 
61 61
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function findParticipantsByPoll($pollId, $limit = null, $offset = null) {
68 68
 		$sql = 'SELECT DISTINCT user_id FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
69
-		return $this->findEntities($sql, [$pollId], $limit, $offset);
69
+		return $this->findEntities($sql, [ $pollId ], $limit, $offset);
70 70
 	}
71 71
 
72 72
 	/**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function deleteByPoll($pollId) {
76 76
 		$sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
77
-		$this->execute($sql, [$pollId]);
77
+		$this->execute($sql, [ $pollId ]);
78 78
 	}
79 79
 
80 80
 	/**
@@ -83,6 +83,6 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function deleteByPollAndUser($pollId, $userId) {
85 85
 		$sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ? AND user_id = ?';
86
-		$this->execute($sql, [$pollId, $userId]);
86
+		$this->execute($sql, [ $pollId, $userId ]);
87 87
 	}
88 88
 }
Please login to merge, or discard this patch.
lib/Db/ParticipationMapper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public function findDistinctByUser($userId, $limit = null, $offset = null) {
46 46
 		$sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?';
47
-		return $this->findEntities($sql, [$userId], $limit, $offset);
47
+		return $this->findEntities($sql, [ $userId ], $limit, $offset);
48 48
 	}
49 49
 
50 50
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function findByPoll($pollId, $limit = null, $offset = null) {
57 57
 		$sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
58
-		return $this->findEntities($sql, [$pollId], $limit, $offset);
58
+		return $this->findEntities($sql, [ $pollId ], $limit, $offset);
59 59
 	}
60 60
 
61 61
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function findParticipantsByPoll($pollId, $limit = null, $offset = null) {
68 68
 		$sql = 'SELECT DISTINCT user_id FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
69
-		return $this->findEntities($sql, [$pollId], $limit, $offset);
69
+		return $this->findEntities($sql, [ $pollId ], $limit, $offset);
70 70
 	}
71 71
 
72 72
 	/**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function deleteByPoll($pollId) {
76 76
 		$sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
77
-		$this->execute($sql, [$pollId]);
77
+		$this->execute($sql, [ $pollId ]);
78 78
 	}
79 79
 
80 80
 	/**
@@ -83,6 +83,6 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function deleteByPollAndUser($pollId, $userId) {
85 85
 		$sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ? AND user_id = ?';
86
-		$this->execute($sql, [$pollId, $userId]);
86
+		$this->execute($sql, [ $pollId, $userId ]);
87 87
 	}
88 88
 }
Please login to merge, or discard this patch.
lib/Controller/PageController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		try {
224 224
 			$poll = $this->eventMapper->findByHash($hash);
225 225
 		} catch (DoesNotExistException $e) {
226
-			return new TemplateResponse('polls', 'no.acc.tmpl', []);
226
+			return new TemplateResponse('polls', 'no.acc.tmpl', [ ]);
227 227
 		}
228 228
 		if ($poll->getType() === 0) {
229 229
 			$dates = $this->dateMapper->findByPoll($poll->getId());
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 			]);
256 256
 		} else {
257 257
 			User::checkLoggedIn();
258
-			return new TemplateResponse('polls', 'no.acc.tmpl', []);
258
+			return new TemplateResponse('polls', 'no.acc.tmpl', [ ]);
259 259
 		}
260 260
 	}
261 261
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	 */
407 407
 	public function createPoll() {
408 408
 		return new TemplateResponse('polls', 'create.tmpl',
409
-			['userId' => $this->userId, 'userMgr' => $this->userMgr, 'urlGenerator' => $this->urlGenerator]);
409
+			[ 'userId' => $this->userId, 'userMgr' => $this->userMgr, 'urlGenerator' => $this->urlGenerator ]);
410 410
 	}
411 411
 
412 412
 	/**
@@ -560,15 +560,15 @@  discard block
 block discarded – undo
560 560
 					$part = new Participation();
561 561
 					$part->setPollId($pollId);
562 562
 					$part->setUserId($userId);
563
-					$part->setDt(date('Y-m-d H:i:s', $dates[$i]));
564
-					$part->setType($types[$i]);
563
+					$part->setDt(date('Y-m-d H:i:s', $dates[ $i ]));
564
+					$part->setType($types[ $i ]);
565 565
 					$this->participationMapper->insert($part);
566 566
 				} else {
567 567
 					$part = new ParticipationText();
568 568
 					$part->setPollId($pollId);
569 569
 					$part->setUserId($userId);
570
-					$part->setText($dates[$i]);
571
-					$part->setType($types[$i]);
570
+					$part->setText($dates[ $i ]);
571
+					$part->setType($types[ $i ]);
572 572
 					$this->participationTextMapper->insert($part);
573 573
 				}
574 574
 
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			$this->sendNotifications($pollId, $userId);
577 577
 		}
578 578
 		$hash = $poll->getHash();
579
-		$url = $this->urlGenerator->linkToRoute('polls.page.goto_poll', ['hash' => $hash]);
579
+		$url = $this->urlGenerator->linkToRoute('polls.page.goto_poll', [ 'hash' => $hash ]);
580 580
 		return new RedirectResponse($url);
581 581
 	}
582 582
 
@@ -633,15 +633,15 @@  discard block
 block discarded – undo
633 633
 		$gids = array();
634 634
 		$sgids = array();
635 635
 		foreach ($selectedGroups as $sg) {
636
-			$sgids[] = str_replace('group_', '', $sg);
636
+			$sgids[ ] = str_replace('group_', '', $sg);
637 637
 		}
638 638
 		foreach ($groups as $g) {
639
-			$gids[] = $g->getGID();
639
+			$gids[ ] = $g->getGID();
640 640
 		}
641 641
 		$diffGids = array_diff($gids, $sgids);
642 642
 		$gids = array();
643 643
 		foreach ($diffGids as $g) {
644
-			$gids[] = ['gid' => $g, 'isGroup' => true];
644
+			$gids[ ] = [ 'gid' => $g, 'isGroup' => true ];
645 645
 		}
646 646
 		return $gids;
647 647
 	}
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 		$users = array();
661 661
 		$sUsers = array();
662 662
 		foreach ($selectedUsers as $su) {
663
-			$sUsers[] = str_replace('user_', '', $su);
663
+			$sUsers[ ] = str_replace('user_', '', $su);
664 664
 		}
665 665
 		foreach ($userNames as $u) {
666 666
 			$alreadyAdded = false;
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 				}
673 673
 			}
674 674
 			if (!$alreadyAdded) {
675
-				$users[] = array('uid' => $u->getUID(), 'displayName' => $u->getDisplayName(), 'isGroup' => false);
675
+				$users[ ] = array('uid' => $u->getUID(), 'displayName' => $u->getDisplayName(), 'isGroup' => false);
676 676
 			} else {
677 677
 				continue;
678 678
 			}
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 		}
701 701
 		// Nextcloud >= 12
702 702
 		$groups = $this->groupManager->getUserGroups(\OC::$server->getUserSession()->getUser());
703
-		return array_map(function ($group) {
703
+		return array_map(function($group) {
704 704
 			return $group->getGID();
705 705
 		}, $groups);
706 706
 	}
Please login to merge, or discard this patch.
templates/goto.tmpl.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -32,23 +32,23 @@  discard block
 block discarded – undo
32 32
 	\OCP\Util::addScript('polls', 'app');
33 33
 	\OCP\Util::addScript('polls', 'vote');
34 34
 
35
-	$userId = $_['userId'];
35
+	$userId = $_[ 'userId' ];
36 36
 	/** @var \OCP\IUserManager $userMgr */
37
-	$userMgr = $_['userMgr'];
37
+	$userMgr = $_[ 'userMgr' ];
38 38
 	/** @var \OCP\IURLGenerator $urlGenerator */
39
-	$urlGenerator = $_['urlGenerator'];
39
+	$urlGenerator = $_[ 'urlGenerator' ];
40 40
 	/** @var \OCP\IAvatarManager $avaMgr */
41
-	$avaMgr = $_['avatarManager'];
41
+	$avaMgr = $_[ 'avatarManager' ];
42 42
 	/** @var \OCA\Polls\Db\Event $poll */
43
-	$poll = $_['poll'];
43
+	$poll = $_[ 'poll' ];
44 44
 	/** @var OCA\Polls\Db\Date[]|OCA\Polls\Db\Text[] $dates */
45
-	$dates = $_['dates'];
45
+	$dates = $_[ 'dates' ];
46 46
 	/** @var OCA\Polls\Db\Participation[]|OCA\Polls\Db\ParticipationText[] $votes */
47
-	$votes = $_['votes'];
47
+	$votes = $_[ 'votes' ];
48 48
 	/** @var \OCA\Polls\Db\Comment[] $comments */
49
-	$comments = $_['comments'];
49
+	$comments = $_[ 'comments' ];
50 50
 	/** @var \OCA\Polls\Db\Notification $notification */
51
-	$notification = $_['notification'];
51
+	$notification = $_[ 'notification' ];
52 52
 
53 53
 	$isAnonymous = $poll->getIsAnonymous() && $userId !== $poll->getOwner();
54 54
 	$hideNames = $poll->getIsAnonymous() && $poll->getFullAnonymous();
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 	// init array for counting 'yes'-votes for each date
90 90
 	$total = array();
91 91
 	for ($i = 0; $i < count($dates); $i++) {
92
-		$total['yes'][$i] = 0;
93
-		$total['no'][$i] = 0;
92
+		$total[ 'yes' ][ $i ] = 0;
93
+		$total[ 'no' ][ $i ] = 0;
94 94
 	}
95 95
 	$userVoted = array();
96
-	$pollUrl = $urlGenerator->linkToRouteAbsolute('polls.page.goto_poll', ['hash' => $poll->getHash()]);
96
+	$pollUrl = $urlGenerator->linkToRouteAbsolute('polls.page.goto_poll', [ 'hash' => $poll->getHash() ]);
97 97
 ?>
98 98
 
99 99
 <div id="app">
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 								print_unescaped('<li id="slot_' . $dateElement->getId() . '" title="' . $dateElement->getDt() . ' ' . date_default_timezone_get() . '" class="column vote time has-tooltip" data-timestamp="' . $timestamp . '"data-value-utc="' . $dateElement->getDt() . '">');
141 141
 
142 142
 								print_unescaped('	<div class="date-box column">');
143
-								print_unescaped('		<div class="month">' . $l->t(date('M', $timestamp))  . '</div>');
144
-								print_unescaped('		<div class="day">'   .       date('j', $timestamp)   . '</div>');
145
-								print_unescaped('		<div class="dayow">' . $l->t(date('D', $timestamp))  . '</div>');
146
-								print_unescaped('		<div class="time">'  .       date('G:i', $timestamp) . ' UTC</div>');
143
+								print_unescaped('		<div class="month">' . $l->t(date('M', $timestamp)) . '</div>');
144
+								print_unescaped('		<div class="day">' . date('j', $timestamp) . '</div>');
145
+								print_unescaped('		<div class="dayow">' . $l->t(date('D', $timestamp)) . '</div>');
146
+								print_unescaped('		<div class="time">' . date('G:i', $timestamp) . ' UTC</div>');
147 147
 								print_unescaped('	</div>');
148 148
 							} else {
149 149
 								print_unescaped('<li id="slot_' . $dateElement->getId() . '" title="' . preg_replace('/_\d+$/', '', $dateElement->getText()) . '" class="column vote option">');
150
-								print_unescaped('	<div class="date-box column">' . preg_replace('/_\d+$/', '', $dateElement->getText()).'</div>');
150
+								print_unescaped('	<div class="date-box column">' . preg_replace('/_\d+$/', '', $dateElement->getText()) . '</div>');
151 151
 							}
152 152
 							print_unescaped('<div class="counter table-row">');
153 153
 							print_unescaped('	<div class="yes table-row">');
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
 						$avatarName = '';
173 173
 						$activeClass = '';
174 174
 						foreach ($votes as $vote) {
175
-							if (!isset($others[$vote->getUserId()])) {
176
-								$others[$vote->getUserId()] = array();
175
+							if (!isset($others[ $vote->getUserId() ])) {
176
+								$others[ $vote->getUserId() ] = array();
177 177
 							}
178
-							$others[$vote->getUserId()][]= $vote;
178
+							$others[ $vote->getUserId() ][ ] = $vote;
179 179
 						}
180 180
 						$userCnt = 0;
181 181
 						foreach (array_keys($others) as $usr) {
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 								// if poll expired, just put current user among the others;
185 185
 								// otherwise skip here to add current user as last table-row (to vote)
186 186
 								if (!$expired) {
187
-									$userVoted = $others[$usr];
187
+									$userVoted = $others[ $usr ];
188 188
 									continue;
189 189
 								}
190 190
 							}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 								}
228 228
 								// look what user voted for this dts
229 229
 								$class = 'column poll-cell no';
230
-								foreach ($others[$usr] as $vote) {
230
+								foreach ($others[ $usr ] as $vote) {
231 231
 									$voteVal = null;
232 232
 									if ($poll->getType() === 0) {
233 233
 										$voteVal = strtotime($vote->getDt());
@@ -237,17 +237,17 @@  discard block
 block discarded – undo
237 237
 									if ($dateId === $voteVal) {
238 238
 										if ($vote->getType() === 1) {
239 239
 											$class = 'column poll-cell yes';
240
-											$total['yes'][$i_tot]++;
240
+											$total[ 'yes' ][ $i_tot ]++;
241 241
 										} else if ($vote->getType() === 0) {
242 242
 											$class = 'column poll-cell no';
243
-											$total['no'][$i_tot]++;
243
+											$total[ 'no' ][ $i_tot ]++;
244 244
 										} else if ($vote->getType() === 2) {
245 245
 											$class = 'column poll-cell maybe';
246 246
 										}
247 247
 										break;
248 248
 									}
249 249
 								}
250
-								print_unescaped('<li id="'. $pollId . '" class="' . $class . '"></li>');
250
+								print_unescaped('<li id="' . $pollId . '" class="' . $class . '"></li>');
251 251
 								$i_tot++;
252 252
 							}
253 253
 
@@ -255,15 +255,15 @@  discard block
 block discarded – undo
255 255
 							print_unescaped('</li>');
256 256
 						}
257 257
 					}
258
-					$totalYesOthers = array_merge(array(), $total['yes']);
259
-					$totalNoOthers = array_merge(array(), $total['no']);
258
+					$totalYesOthers = array_merge(array(), $total[ 'yes' ]);
259
+					$totalNoOthers = array_merge(array(), $total[ 'no' ]);
260 260
 					$toggleTooltip = $l->t('Switch all options at once');
261 261
 					if (!$expired) {
262 262
 						print_unescaped('<li class="table-row user current-user">');
263 263
 						print_unescaped('	<div class="table-row first">');
264 264
 						print_unescaped('		<div class="user-cell table-row">');
265 265
 						if (User::isLoggedIn()) {
266
-							print_unescaped('		<div class="avatar has-tooltip" title="'.($userId).'"></div>');
266
+							print_unescaped('		<div class="avatar has-tooltip" title="' . ($userId) . '"></div>');
267 267
 							print_unescaped('		<div class="name">');
268 268
 							p($userMgr->get($userId)->getDisplayName());
269 269
 						} else {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 						}
273 273
 						print_unescaped('		</div>');
274 274
 						print_unescaped('	</div>');
275
-						print_unescaped('	<div id="toggle-cell" class="toggle-cell has-tooltip maybe" title="'. $toggleTooltip .'">');
275
+						print_unescaped('	<div id="toggle-cell" class="toggle-cell has-tooltip maybe" title="' . $toggleTooltip . '">');
276 276
 						print_unescaped('		<div class="toggle"></div>');
277 277
 						print_unescaped('	</div>');
278 278
 						print_unescaped('</div>');
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 							if (isset($userVoted)) {
294 294
 								foreach ($userVoted as $obj) {
295 295
 									$voteVal = null;
296
-									if($poll->getType() === 0) {
296
+									if ($poll->getType() === 0) {
297 297
 										$voteVal = strtotime($obj->getDt());
298 298
 									} else {
299 299
 										$voteVal = $obj->getText();
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
 									if ($voteVal === $dateId) {
302 302
 										if ($obj->getType() === 1) {
303 303
 											$class = 'yes';
304
-											$total['yes'][$i_tot]++;
305
-										} else if($obj->getType() === 2) {
304
+											$total[ 'yes' ][ $i_tot ]++;
305
+										} else if ($obj->getType() === 2) {
306 306
 											$class = 'maybe';
307 307
 										}
308 308
 										break;
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
 
343 343
 		<div id="app-sidebar" class="detailsView scroll-container disappear">
344 344
 			<div class="close table-row">
345
-				<a id="closeDetails" class="close icon-close" href="#" alt="<?php $l->t('Close');?>"></a>
345
+				<a id="closeDetails" class="close icon-close" href="#" alt="<?php $l->t('Close'); ?>"></a>
346 346
 			</div>
347 347
 
348 348
 			<div class="header table-row">
@@ -356,9 +356,9 @@  discard block
 block discarded – undo
356 356
 					<div class="cloud">
357 357
 						<?php
358 358
 						if ($expired) {
359
-							print_unescaped('<span class="expired">' . $l->t('Expired'). '</span>');
359
+							print_unescaped('<span class="expired">' . $l->t('Expired') . '</span>');
360 360
 						} else {
361
-							if ($poll->getExpire() !== null){
361
+							if ($poll->getExpire() !== null) {
362 362
 								print_unescaped('<span class="open">' . $l->t('Expires on %s', array(date('d.m.Y', strtotime($poll->getExpire())))) . '</span>');
363 363
 							} else {
364 364
 								print_unescaped('<span class="open">' . $l->t('Expires never') . '</span>');
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 							</a>
398 398
 						</li>
399 399
 						<li>
400
-							<a id="id_edit_<?php p($poll->getId()); ?>" class="icon-rename svg" href="<?php p($urlGenerator->linkToRoute('polls.page.edit_poll', ['hash' => $poll->getHash()])); ?>">
400
+							<a id="id_edit_<?php p($poll->getId()); ?>" class="icon-rename svg" href="<?php p($urlGenerator->linkToRoute('polls.page.edit_poll', [ 'hash' => $poll->getHash() ])); ?>">
401 401
 								<?php p($l->t('Edit Poll')); ?>
402 402
 							</a>
403 403
 						</li>
@@ -462,13 +462,13 @@  discard block
 block discarded – undo
462 462
 					<?php foreach ($comments as $comment) : ?>
463 463
 
464 464
 						<?php
465
-							if ( $comment->getUserId() === $userId ) {
465
+							if ($comment->getUserId() === $userId) {
466 466
 								// Comment is from current user
467 467
 								// -> display user
468 468
 								$avatarName = $userId;
469 469
 								$displayName = $userMgr->get($userId)->getDisplayName();
470 470
 
471
-							} else if ( !$isAnonymous && !$hideNames ) {
471
+							} else if (!$isAnonymous && !$hideNames) {
472 472
 								// comment is from another user,
473 473
 								// poll is not anoymous (for current user)
474 474
 								// users are not hidden
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 							<div class="authorRow user-cell table-row">
493 493
 								<div class="avatar has-tooltip" title="<?php p($avatarName)?>"></div>
494 494
 								<div class="author"><?php p($displayName) ?></div>
495
-								<div class="date has-tooltip live-relative-timestamp datespan" data-timestamp="<?php p(strtotime($comment->getDt())*1000); ?>" title="<?php p($comment->getDt()) ?>"><?php p(\OCP\Template::relative_modified_date(strtotime($comment->getDt()))) ?></div>
495
+								<div class="date has-tooltip live-relative-timestamp datespan" data-timestamp="<?php p(strtotime($comment->getDt()) * 1000); ?>" title="<?php p($comment->getDt()) ?>"><?php p(\OCP\Template::relative_modified_date(strtotime($comment->getDt()))) ?></div>
496 496
 							</div>
497 497
 							<div class="message wordwrap comment-content"><?php p($comment->getComment()); ?></div>
498 498
 						</li>
Please login to merge, or discard this patch.