Test Failed
Branch master (fee893)
by René
03:21
created
lib/Controller/PageController.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,12 +134,12 @@
 block discarded – undo
134 134
         $polls = $this->eventMapper->findAllForUserWithInfo($this->userId);
135 135
         $comments = $this->commentMapper->findDistinctByUser($this->userId);
136 136
         $partic = $this->participationMapper->findDistinctByUser($this->userId);
137
-		$particText = $this->participationTextMapper->findDistinctByUser($this->userId);
137
+        $particText = $this->participationTextMapper->findDistinctByUser($this->userId);
138 138
         $response = new TemplateResponse('polls', 'main.tmpl', [
139 139
             'polls' => $polls,
140 140
             'comments' => $comments,
141 141
             'participations' => $partic,
142
-			'participations_text' => $particText,
142
+            'participations_text' => $particText,
143 143
             'userId' => $this->userId,
144 144
             'userMgr' => $this->manager,
145 145
             'urlGenerator' => $this->urlGenerator
Please login to merge, or discard this 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
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
      */
388 388
     public function createPoll() {
389 389
         return new TemplateResponse('polls', 'create.tmpl',
390
-            ['userId' => $this->userId, 'userMgr' => $this->manager, 'urlGenerator' => $this->urlGenerator]);
390
+            [ 'userId' => $this->userId, 'userMgr' => $this->manager, 'urlGenerator' => $this->urlGenerator ]);
391 391
     }
392 392
 
393 393
     /**
@@ -538,15 +538,15 @@  discard block
 block discarded – undo
538 538
                     $part = new Participation();
539 539
                     $part->setPollId($pollId);
540 540
                     $part->setUserId($userId);
541
-                    $part->setDt(date('Y-m-d H:i:s', $dates[$i]));
542
-                    $part->setType($types[$i]);
541
+                    $part->setDt(date('Y-m-d H:i:s', $dates[ $i ]));
542
+                    $part->setType($types[ $i ]);
543 543
                     $this->participationMapper->insert($part);
544 544
                 } else {
545 545
                     $part = new ParticipationText();
546 546
                     $part->setPollId($pollId);
547 547
                     $part->setUserId($userId);
548
-                    $part->setText($dates[$i]);
549
-                    $part->setType($types[$i]);
548
+                    $part->setText($dates[ $i ]);
549
+                    $part->setType($types[ $i ]);
550 550
                     $this->participationTextMapper->insert($part);
551 551
                 }
552 552
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
             $this->sendNotifications($pollId, $userId);
555 555
         }
556 556
         $hash = $poll->getHash();
557
-        $url = $this->urlGenerator->linkToRoute('polls.page.goto_poll', ['hash' => $hash]);
557
+        $url = $this->urlGenerator->linkToRoute('polls.page.goto_poll', [ 'hash' => $hash ]);
558 558
         return new RedirectResponse($url);
559 559
     }
560 560
 
@@ -612,15 +612,15 @@  discard block
 block discarded – undo
612 612
         $gids = array();
613 613
         $sgids = array();
614 614
         foreach ($selectedGroups as $sg) {
615
-            $sgids[] = str_replace('group_', '', $sg);
615
+            $sgids[ ] = str_replace('group_', '', $sg);
616 616
         }
617 617
         foreach ($groups as $g) {
618
-            $gids[] = $g->getGID();
618
+            $gids[ ] = $g->getGID();
619 619
         }
620 620
         $diffGids = array_diff($gids, $sgids);
621 621
         $gids = array();
622 622
         foreach ($diffGids as $g) {
623
-            $gids[] = ['gid' => $g, 'isGroup' => true];
623
+            $gids[ ] = [ 'gid' => $g, 'isGroup' => true ];
624 624
         }
625 625
         return $gids;
626 626
     }
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
         $users = array();
640 640
         $sUsers = array();
641 641
         foreach ($selectedUsers as $su) {
642
-            $sUsers[] = str_replace('user_', '', $su);
642
+            $sUsers[ ] = str_replace('user_', '', $su);
643 643
         }
644 644
         foreach ($userNames as $u) {
645 645
             $alreadyAdded = false;
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
                 }
652 652
             }
653 653
             if (!$alreadyAdded) {
654
-                $users[] = array('uid' => $u->getUID(), 'displayName' => $u->getDisplayName(), 'isGroup' => false);
654
+                $users[ ] = array('uid' => $u->getUID(), 'displayName' => $u->getDisplayName(), 'isGroup' => false);
655 655
             } else {
656 656
                 continue;
657 657
             }
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
         }
700 700
         // Nextcloud >= 12
701 701
         $groups = \OC::$server->getGroupManager()->getUserGroups(\OC::$server->getUserSession()->getUser());
702
-        return array_map(function ($group) {
702
+        return array_map(function($group) {
703 703
             return $group->getGID();
704 704
         }, $groups);
705 705
     }
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 ($c) use ($server) {
52
+        $container->registerService('PageController', function($c) use ($server) {
53 53
             /** @var SimpleContainer $c */
54 54
             return new PageController(
55 55
                 $c->query('AppName'),
@@ -71,73 +71,73 @@  discard block
 block discarded – undo
71 71
             );
72 72
         });
73 73
 
74
-        $container->registerService('UserManager', function ($c) {
74
+        $container->registerService('UserManager', function($c) {
75 75
             /** @var SimpleContainer $c */
76 76
             return $c->query('ServerContainer')->getUserManager();
77 77
         });
78 78
 
79
-        $container->registerService('GroupManager', function ($c) {
79
+        $container->registerService('GroupManager', function($c) {
80 80
             /** @var SimpleContainer $c */
81 81
             return $c->query('ServerContainer')->getGroupManager();
82 82
         });
83 83
 
84
-        $container->registerService('AvatarManager', function ($c) {
84
+        $container->registerService('AvatarManager', function($c) {
85 85
             /** @var SimpleContainer $c */
86 86
             return $c->query('ServerContainer')->getAvatarManager();
87 87
         });
88 88
 
89
-        $container->registerService('Logger', function ($c) {
89
+        $container->registerService('Logger', function($c) {
90 90
             /** @var SimpleContainer $c */
91 91
             return $c->query('ServerContainer')->getLogger();
92 92
         });
93 93
 
94
-        $container->registerService('L10N', function ($c) {
94
+        $container->registerService('L10N', function($c) {
95 95
             return $c->query('ServerContainer')->getL10N($c->query('AppName'));
96 96
         });
97 97
 
98
-        $container->registerService('CommentMapper', function ($c) use ($server) {
98
+        $container->registerService('CommentMapper', function($c) use ($server) {
99 99
             /** @var SimpleContainer $c */
100 100
             return new CommentMapper(
101 101
                 $server->getDatabaseConnection()
102 102
             );
103 103
         });
104 104
 
105
-        $container->registerService('DateMapper', function ($c) use ($server) {
105
+        $container->registerService('DateMapper', function($c) use ($server) {
106 106
             /** @var SimpleContainer $c */
107 107
             return new DateMapper(
108 108
                 $server->getDatabaseConnection()
109 109
             );
110 110
         });
111 111
 
112
-        $container->registerService('EventMapper', function ($c) use ($server) {
112
+        $container->registerService('EventMapper', function($c) use ($server) {
113 113
             /** @var SimpleContainer $c */
114 114
             return new EventMapper(
115 115
                 $server->getDatabaseConnection()
116 116
             );
117 117
         });
118 118
 
119
-        $container->registerService('NotificationMapper', function ($c) use ($server) {
119
+        $container->registerService('NotificationMapper', function($c) use ($server) {
120 120
             /** @var SimpleContainer $c */
121 121
             return new NotificationMapper(
122 122
                 $server->getDatabaseConnection()
123 123
             );
124 124
         });
125 125
 
126
-        $container->registerService('ParticipationMapper', function ($c) use ($server) {
126
+        $container->registerService('ParticipationMapper', function($c) use ($server) {
127 127
             /** @var SimpleContainer $c */
128 128
             return new ParticipationMapper(
129 129
                 $server->getDatabaseConnection()
130 130
             );
131 131
         });
132 132
 
133
-        $container->registerService('ParticipationTextMapper', function ($c) use ($server) {
133
+        $container->registerService('ParticipationTextMapper', function($c) use ($server) {
134 134
             /** @var SimpleContainer $c */
135 135
             return new ParticipationTextMapper(
136 136
                 $server->getDatabaseConnection()
137 137
             );
138 138
         });
139 139
 
140
-        $container->registerService('TextMapper', function ($c) use ($server) {
140
+        $container->registerService('TextMapper', function($c) use ($server) {
141 141
             /** @var SimpleContainer $c */
142 142
             return new TextMapper(
143 143
                 $server->getDatabaseConnection()
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function registerNavigationEntry() {
152 152
         $container = $this->getContainer();
153
-        $container->query('OCP\INavigationManager')->add(function () use ($container) {
153
+        $container->query('OCP\INavigationManager')->add(function() use ($container) {
154 154
             $urlGenerator = $container->query('OCP\IURLGenerator');
155 155
             $l10n = $container->query('OCP\IL10N');
156 156
             return [
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.
lib/Db/NotificationMapper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function find($id) {
42 42
         $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE id = ?';
43
-        return $this->findEntity($sql, [$id]);
43
+        return $this->findEntity($sql, [ $id ]);
44 44
     }
45 45
 
46 46
     /**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function findBetween($userId, $from, $until, $limit = null, $offset = null) {
55 55
         $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE userId = ? AND timestamp BETWEEN ? AND ?';
56
-        return $this->findEntities($sql, [$userId, $from, $until], $limit, $offset);
56
+        return $this->findEntities($sql, [ $userId, $from, $until ], $limit, $offset);
57 57
     }
58 58
 
59 59
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function findAll($limit = null, $offset = null) {
65 65
         $sql = 'SELECT * FROM ' . $this->getTableName();
66
-        return $this->findEntities($sql, [], $limit, $offset);
66
+        return $this->findEntities($sql, [ ], $limit, $offset);
67 67
     }
68 68
 
69 69
     /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function findAllByPoll($pollId, $limit = null, $offset = null) {
76 76
         $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?';
77
-        return $this->findEntities($sql, [$pollId], $limit, $offset);
77
+        return $this->findEntities($sql, [ $pollId ], $limit, $offset);
78 78
     }
79 79
 
80 80
     /**
@@ -84,6 +84,6 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function findByUserAndPoll($pollId, $userId) {
86 86
         $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ? AND user_id = ?';
87
-        return $this->findEntity($sql, [$pollId, $userId]);
87
+        return $this->findEntity($sql, [ $pollId, $userId ]);
88 88
     }
89 89
 }
Please login to merge, or discard this patch.
lib/Db/TextMapper.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.
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/Db/EventMapper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function find($id) {
46 46
         $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE id = ?';
47
-        return $this->findEntity($sql, [$id]);
47
+        return $this->findEntity($sql, [ $id ]);
48 48
     }
49 49
 
50 50
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function findByHash($hash, $limit = null, $offset = null) {
57 57
         $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE hash = ?';
58
-        return $this->findEntity($sql, [$hash], $limit, $offset);
58
+        return $this->findEntity($sql, [ $hash ], $limit, $offset);
59 59
     }
60 60
 
61 61
     /**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function findAllForUser($userId, $limit = null, $offset = null) {
68 68
         $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE owner = ?';
69
-        return $this->findEntities($sql, [$userId], $limit, $offset);
69
+        return $this->findEntities($sql, [ $userId ], $limit, $offset);
70 70
     }
71 71
 
72 72
     /**
@@ -101,6 +101,6 @@  discard block
 block discarded – undo
101 101
                     OR
102 102
                     *PREFIX*polls_comments.user_id = ?
103 103
                     ORDER BY created';
104
-        return $this->findEntities($sql, ['hidden', $userId, 'hidden', $userId, $userId], $limit, $offset);
104
+        return $this->findEntities($sql, [ 'hidden', $userId, 'hidden', $userId, $userId ], $limit, $offset);
105 105
     }
106 106
 }
Please login to merge, or discard this patch.
lib/Db/ParticipationMapper.php 1 patch
Spacing   +4 added lines, -4 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
     /**
@@ -63,7 +63,7 @@  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
 
69 69
     /**
@@ -72,6 +72,6 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function deleteByPollAndUser($pollId, $userId) {
74 74
         $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ? AND user_id = ?';
75
-        $this->execute($sql, [$pollId, $userId]);
75
+        $this->execute($sql, [ $pollId, $userId ]);
76 76
     }
77 77
 }
Please login to merge, or discard this patch.
lib/Db/ParticipationTextMapper.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -47,16 +47,16 @@
 block discarded – undo
47 47
         return $this->findEntities($sql, [$pollId], $limit, $offset);
48 48
     }
49 49
 
50
-	/**
51
-	 * @param string $userId
52
-	 * @param int $limit
53
-	 * @param int $offset
54
-	 * @return ParticipationText[]
55
-	 */
56
-	public function findDistinctByUser($userId, $limit = null, $offset = null) {
57
-		$sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?';
58
-		return $this->findEntities($sql, [$userId], $limit, $offset);
59
-	}
50
+    /**
51
+     * @param string $userId
52
+     * @param int $limit
53
+     * @param int $offset
54
+     * @return ParticipationText[]
55
+     */
56
+    public function findDistinctByUser($userId, $limit = null, $offset = null) {
57
+        $sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?';
58
+        return $this->findEntities($sql, [$userId], $limit, $offset);
59
+    }
60 60
 
61 61
     /**
62 62
      * @param string $pollId
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 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
     /**
@@ -63,7 +63,7 @@  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
 
69 69
     /**
@@ -72,6 +72,6 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function deleteByPollAndUser($pollId, $userId) {
74 74
         $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ? AND user_id = ?';
75
-        $this->execute($sql, [$pollId, $userId]);
75
+        $this->execute($sql, [ $pollId, $userId ]);
76 76
     }
77 77
 }
Please login to merge, or discard this patch.