Completed
Pull Request — master (#213)
by Morris
02:35
created
lib/Db/CommentMapper.php 1 patch
Spacing   +3 added lines, -3 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 = ? ORDER BY Dt DESC';
58
-		return $this->findEntities($sql, [$pollId], $limit, $offset);
58
+		return $this->findEntities($sql, [ $pollId ], $limit, $offset);
59 59
 	}
60 60
 
61 61
 	/**
@@ -63,6 +63,6 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	public function deleteByPoll($pollId) {
65 65
 		$sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
66
-		$this->execute($sql, [$pollId]);
66
+		$this->execute($sql, [ $pollId ]);
67 67
 	}
68 68
 }
Please login to merge, or discard this patch.
lib/Controller/PageController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			]);
247 247
 		} else {
248 248
 			User::checkLoggedIn();
249
-			return new TemplateResponse('polls', 'no.acc.tmpl', []);
249
+			return new TemplateResponse('polls', 'no.acc.tmpl', [ ]);
250 250
 		}
251 251
 	}
252 252
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 	 */
394 394
 	public function createPoll() {
395 395
 		return new TemplateResponse('polls', 'create.tmpl',
396
-			['userId' => $this->userId, 'userMgr' => $this->manager, 'urlGenerator' => $this->urlGenerator]);
396
+			[ 'userId' => $this->userId, 'userMgr' => $this->manager, 'urlGenerator' => $this->urlGenerator ]);
397 397
 	}
398 398
 
399 399
 	/**
@@ -545,15 +545,15 @@  discard block
 block discarded – undo
545 545
 					$part = new Participation();
546 546
 					$part->setPollId($pollId);
547 547
 					$part->setUserId($userId);
548
-					$part->setDt(date('Y-m-d H:i:s', $dates[$i]));
549
-					$part->setType($types[$i]);
548
+					$part->setDt(date('Y-m-d H:i:s', $dates[ $i ]));
549
+					$part->setType($types[ $i ]);
550 550
 					$this->participationMapper->insert($part);
551 551
 				} else {
552 552
 					$part = new ParticipationText();
553 553
 					$part->setPollId($pollId);
554 554
 					$part->setUserId($userId);
555
-					$part->setText($dates[$i]);
556
-					$part->setType($types[$i]);
555
+					$part->setText($dates[ $i ]);
556
+					$part->setType($types[ $i ]);
557 557
 					$this->participationTextMapper->insert($part);
558 558
 				}
559 559
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 			$this->sendNotifications($pollId, $userId);
562 562
 		}
563 563
 		$hash = $poll->getHash();
564
-		$url = $this->urlGenerator->linkToRoute('polls.page.goto_poll', ['hash' => $hash]);
564
+		$url = $this->urlGenerator->linkToRoute('polls.page.goto_poll', [ 'hash' => $hash ]);
565 565
 		return new RedirectResponse($url);
566 566
 	}
567 567
 
@@ -619,15 +619,15 @@  discard block
 block discarded – undo
619 619
 		$gids = array();
620 620
 		$sgids = array();
621 621
 		foreach ($selectedGroups as $sg) {
622
-			$sgids[] = str_replace('group_', '', $sg);
622
+			$sgids[ ] = str_replace('group_', '', $sg);
623 623
 		}
624 624
 		foreach ($groups as $g) {
625
-			$gids[] = $g->getGID();
625
+			$gids[ ] = $g->getGID();
626 626
 		}
627 627
 		$diffGids = array_diff($gids, $sgids);
628 628
 		$gids = array();
629 629
 		foreach ($diffGids as $g) {
630
-			$gids[] = ['gid' => $g, 'isGroup' => true];
630
+			$gids[ ] = [ 'gid' => $g, 'isGroup' => true ];
631 631
 		}
632 632
 		return $gids;
633 633
 	}
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
 		$users = array();
647 647
 		$sUsers = array();
648 648
 		foreach ($selectedUsers as $su) {
649
-			$sUsers[] = str_replace('user_', '', $su);
649
+			$sUsers[ ] = str_replace('user_', '', $su);
650 650
 		}
651 651
 		foreach ($userNames as $u) {
652 652
 			$alreadyAdded = false;
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 				}
659 659
 			}
660 660
 			if (!$alreadyAdded) {
661
-				$users[] = array('uid' => $u->getUID(), 'displayName' => $u->getDisplayName(), 'isGroup' => false);
661
+				$users[ ] = array('uid' => $u->getUID(), 'displayName' => $u->getDisplayName(), 'isGroup' => false);
662 662
 			} else {
663 663
 				continue;
664 664
 			}
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 		}
706 706
 		// Nextcloud >= 12
707 707
 		$groups = \OC::$server->getGroupManager()->getUserGroups(\OC::$server->getUserSession()->getUser());
708
-		return array_map(function ($group) {
708
+		return array_map(function($group) {
709 709
 			return $group->getGID();
710 710
 		}, $groups);
711 711
 	}
Please login to merge, or discard this patch.
lib/Db/DateMapper.php 1 patch
Spacing   +2 added lines, -2 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
 	/**
@@ -52,6 +52,6 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function deleteByPoll($pollId) {
54 54
 		$sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
55
-		$this->execute($sql, [$pollId]);
55
+		$this->execute($sql, [ $pollId ]);
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.