Completed
Pull Request — develop-0.9 (#315)
by René
06:00
created
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/EventFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
31 31
 	'title' => Faker::sentence(10),
32 32
 	'description' => Faker::text(255),
33 33
 	'owner' => Faker::firstNameMale(),
34
-	'created' => function () {
34
+	'created' => function() {
35 35
 		$date = new DateTime('today');
36 36
 		return $date->format('Y-m-d H:i:s');
37 37
 	},
38 38
 	'access' => 'registered',
39
-	'expire' => function () {
39
+	'expire' => function() {
40 40
 		$date = new DateTime('tomorrow');
41 41
 		return $date->format('Y-m-d H:i:s');
42 42
 	},
Please login to merge, or discard this patch.
templates/main.tmpl.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 					<div class="table-row table-body">
152 152
 						<div class="wrapper group-master">
153 153
 							<div class="wrapper group-1">
154
-								<div class="thumbnail <?php p($expiry_style . ' ' . $commented_class. ' ' . $participated_class); ?>"></div><!-- Image to display the status or type of poll -->
154
+								<div class="thumbnail <?php p($expiry_style . ' ' . $commented_class . ' ' . $participated_class); ?>"></div><!-- Image to display the status or type of poll -->
155 155
 								<a href="<?php p($pollUrl); ?>" class="wrapper group-1-1">
156 156
 									<div class="flex-column name">						  <?php p($poll->getTitle()); ?></div>
157 157
 									<div class="flex-column description">				   <?php p($poll->getDescription()); ?></div>
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
 								</div>
194 194
 								<div class="wrapper group-2-1">
195 195
 									<div class="flex-column access"><?php p($l->t($poll->getAccess())); ?></div>
196
-									<div class="flex-column created has-tooltip live-relative-timestamp" data-timestamp="<?php p(strtotime($poll->getCreated())*1000); ?>" data-value="<?php p($poll->getCreated()); ?>"><?php p(\OCP\Template::relative_modified_date(strtotime($poll->getCreated()))); ?></div>
196
+									<div class="flex-column created has-tooltip live-relative-timestamp" data-timestamp="<?php p(strtotime($poll->getCreated()) * 1000); ?>" data-value="<?php p($poll->getCreated()); ?>"><?php p(\OCP\Template::relative_modified_date(strtotime($poll->getCreated()))); ?></div>
197 197
 								</div>
198 198
 								<div class="wrapper group-2-2">
199
-									<div class="flex-column has-tooltip expiry<?php p($expiry_style . $timestamp_style); ?>" data-timestamp="<?php p(strtotime($poll->getExpire())*1000); ?>" data-value="<?php p($poll->getExpire()); ?>"> <?php p($expiry_date); ?></div>
199
+									<div class="flex-column has-tooltip expiry<?php p($expiry_style . $timestamp_style); ?>" data-timestamp="<?php p(strtotime($poll->getExpire()) * 1000); ?>" data-value="<?php p($poll->getExpire()); ?>"> <?php p($expiry_date); ?></div>
200 200
 									<div class="flex-column participants">
201 201
 										<div class="symbol alt-tooltip partic_voted icon-<?php p($participated_class); ?>" title="<?php p($participated_title); ?>"></div>
202 202
 										<div class="symbol alt-tooltip partic_commented icon-<?php p($commented_class); ?>" title="<?php p($commented_title); ?>"></div>
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	}
229 229
 	// Nextcloud >= 12
230 230
 	$groups = \OC::$server->getGroupManager()->getUserGroups(\OC::$server->getUserSession()->getUser());
231
-	return array_map(function ($group) {
231
+	return array_map(function($group) {
232 232
 		return $group->getGID();
233 233
 	}, $groups);
234 234
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -261,8 +261,7 @@
 block discarded – undo
261 261
 					return true;
262 262
 				}
263 263
 			}
264
-		}
265
-		else if (strpos($item, 'user_') === 0) {
264
+		} else if (strpos($item, 'user_') === 0) {
266 265
 			$usr = substr($item, 5);
267 266
 			if ($usr === $userId) {
268 267
 				return true;
Please login to merge, or discard this patch.
templates/goto.tmpl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 							
272 272
 							if ($class === 'unvoted') {
273 273
 								$dataUnvoted = $l->t('New option!');
274
-								$updatedPoll=true;
274
+								$updatedPoll = true;
275 275
 							}
276 276
 							
277 277
 							print_unescaped('<li id="voteid_' . $optionElement->getId() . '" class="flex-column active poll-cell ' . $class . '" data-value="' . $optionElement->getPollOptionText() . '" data-unvoted="' . $dataUnvoted . '"></li>');
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 			</div>
287 287
 			<?php if ($updatedPoll) : ?>
288 288
 				<div class="updated-poll alert">
289
-				<p> <?php p($l->t('This poll was updated since your last visit. Please check your votes.'));?></p>
289
+				<p> <?php p($l->t('This poll was updated since your last visit. Please check your votes.')); ?></p>
290 290
 				</div>
291 291
 			<?php endif; ?>
292 292
 			
Please login to merge, or discard this patch.
lib/Migration/Version009000Date20171202105141.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -353,7 +353,7 @@
 block discarded – undo
353 353
 			// ->where($queryFind->expr()->eq('poll_id', $pollId))
354 354
 			// ->andWhere($queryFind->expr()->eq('poll_option', $text));
355 355
 			->where('poll_id = "' . $pollId . '"')
356
-			->andWhere('poll_option_text ="' . $text .'"');
356
+			->andWhere('poll_option_text ="' . $text . '"');
357 357
 
358 358
 		$resultFind = $queryFind->execute();
359 359
 		$row = $resultFind->fetch();
Please login to merge, or discard this patch.
lib/Controller/PageController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -454,7 +454,7 @@
 block discarded – undo
454 454
 			foreach ($optionsArray as $optionElement) {
455 455
 				$option = new Options();
456 456
 				$option->setPollId($pollId);
457
-				$option->setPollOptionText(date('Y-m-d H:i:s', (int)$optionElement));
457
+				$option->setPollOptionText(date('Y-m-d H:i:s', (int) $optionElement));
458 458
 				$this->optionsMapper->insert($option);
459 459
 			}
460 460
 		} else {
Please login to merge, or discard this patch.
lib/Controller/ApiController.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,12 +74,12 @@
 block discarded – undo
74 74
 	}
75 75
 
76 76
   	/**
77
-	* @NoAdminRequired
78
-	* @NoCSRFRequired
79
-	* @PublicPage
80
-	* @param string $hash
81
-	* @return JSONResponse
82
-	*/
77
+  	 * @NoAdminRequired
78
+  	 * @NoCSRFRequired
79
+  	 * @PublicPage
80
+  	 * @param string $hash
81
+  	 * @return JSONResponse
82
+  	 */
83 83
 	public function getPoll($hash) {
84 84
 		try {
85 85
 			$poll = $this->eventMapper->findByHash($hash);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -259,7 +259,7 @@
 block discarded – undo
259 259
 			}
260 260
 		}
261 261
 
262
-		return new JSONResponse( json_encode(array(
262
+		return new JSONResponse(json_encode(array(
263 263
 			'id' => $newEvent->getId(),
264 264
 			'hash' => $newEvent->getHash()
265 265
 		)));
Please login to merge, or discard this patch.