Passed
Pull Request — master (#260)
by Kai
02:59
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.
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.
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(256),
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.
lib/AppInfo/Application.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		/**
50 50
 		 * Controllers
51 51
 		 */
52
-		$container->registerService('PageController', function (IContainer $c) {
52
+		$container->registerService('PageController', function(IContainer $c) {
53 53
 			return new PageController(
54 54
 				$c->query('AppName'),
55 55
 				$c->query('Request'),
@@ -70,63 +70,63 @@  discard block
 block discarded – undo
70 70
 			);
71 71
 		});
72 72
 
73
-		$container->registerService('UserManager', function (IContainer $c) {
73
+		$container->registerService('UserManager', function(IContainer $c) {
74 74
 			return $c->query('ServerContainer')->getUserManager();
75 75
 		});
76 76
 
77
-		$container->registerService('GroupManager', function (IContainer $c) {
77
+		$container->registerService('GroupManager', function(IContainer $c) {
78 78
 			return $c->query('ServerContainer')->getGroupManager();
79 79
 		});
80 80
 
81
-		$container->registerService('AvatarManager', function (IContainer $c) {
81
+		$container->registerService('AvatarManager', function(IContainer $c) {
82 82
 			return $c->query('ServerContainer')->getAvatarManager();
83 83
 		});
84 84
 
85
-		$container->registerService('Logger', function (IContainer $c) {
85
+		$container->registerService('Logger', function(IContainer $c) {
86 86
 			return $c->query('ServerContainer')->getLogger();
87 87
 		});
88 88
 
89
-		$container->registerService('L10N', function (IContainer $c) {
89
+		$container->registerService('L10N', function(IContainer $c) {
90 90
 			return $c->query('ServerContainer')->getL10N($c->query('AppName'));
91 91
 		});
92 92
 
93
-		$container->registerService('CommentMapper', function (IContainer $c) use ($server) {
93
+		$container->registerService('CommentMapper', function(IContainer $c) use ($server) {
94 94
 			return new CommentMapper(
95 95
 				$server->getDatabaseConnection()
96 96
 			);
97 97
 		});
98 98
 
99
-		$container->registerService('DateMapper', function (IContainer $c) use ($server) {
99
+		$container->registerService('DateMapper', function(IContainer $c) use ($server) {
100 100
 			return new DateMapper(
101 101
 				$server->getDatabaseConnection()
102 102
 			);
103 103
 		});
104 104
 
105
-		$container->registerService('EventMapper', function (IContainer $c) use ($server) {
105
+		$container->registerService('EventMapper', function(IContainer $c) use ($server) {
106 106
 			return new EventMapper(
107 107
 				$server->getDatabaseConnection()
108 108
 			);
109 109
 		});
110 110
 
111
-		$container->registerService('NotificationMapper', function (IContainer $c) use ($server) {
111
+		$container->registerService('NotificationMapper', function(IContainer $c) use ($server) {
112 112
 			return new NotificationMapper(
113 113
 				$server->getDatabaseConnection()
114 114
 			);
115 115
 		});
116 116
 
117
-		$container->registerService('ParticipationMapper', function (IContainer $c) use ($server) {
117
+		$container->registerService('ParticipationMapper', function(IContainer $c) use ($server) {
118 118
 			return new ParticipationMapper(
119 119
 				$server->getDatabaseConnection()
120 120
 			);
121 121
 		});
122 122
 
123
-		$container->registerService('ParticipationTextMapper', function (IContainer $c) use ($server) {
123
+		$container->registerService('ParticipationTextMapper', function(IContainer $c) use ($server) {
124 124
 			return new ParticipationTextMapper(
125 125
 				$server->getDatabaseConnection()
126 126
 			);
127 127
 		});
128 128
 
129
-		$container->registerService('TextMapper', function (IContainer $c) use ($server) {
129
+		$container->registerService('TextMapper', function(IContainer $c) use ($server) {
130 130
 			return new TextMapper(
131 131
 				$server->getDatabaseConnection()
132 132
 			);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 	 */
139 139
 	public function registerNavigationEntry() {
140 140
 		$container = $this->getContainer();
141
-		$container->query('OCP\INavigationManager')->add(function () use ($container) {
141
+		$container->query('OCP\INavigationManager')->add(function() use ($container) {
142 142
 			$urlGenerator = $container->query('OCP\IURLGenerator');
143 143
 			$l10n = $container->query('OCP\IL10N');
144 144
 			return [
Please login to merge, or discard this patch.