@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * Controllers |
| 52 | 52 | */ |
| 53 | - $container->registerService('PageController', function ($c) use ($server) { |
|
| 53 | + $container->registerService('PageController', function($c) use ($server) { |
|
| 54 | 54 | /** @var SimpleContainer $c */ |
| 55 | 55 | return new PageController( |
| 56 | 56 | $c->query('AppName'), |
@@ -72,73 +72,73 @@ discard block |
||
| 72 | 72 | ); |
| 73 | 73 | }); |
| 74 | 74 | |
| 75 | - $container->registerService('UserManager', function ($c) { |
|
| 75 | + $container->registerService('UserManager', function($c) { |
|
| 76 | 76 | /** @var SimpleContainer $c */ |
| 77 | 77 | return $c->query('ServerContainer')->getUserManager(); |
| 78 | 78 | }); |
| 79 | 79 | |
| 80 | - $container->registerService('GroupManager', function ($c) { |
|
| 80 | + $container->registerService('GroupManager', function($c) { |
|
| 81 | 81 | /** @var SimpleContainer $c */ |
| 82 | 82 | return $c->query('ServerContainer')->getGroupManager(); |
| 83 | 83 | }); |
| 84 | 84 | |
| 85 | - $container->registerService('AvatarManager', function ($c) { |
|
| 85 | + $container->registerService('AvatarManager', function($c) { |
|
| 86 | 86 | /** @var SimpleContainer $c */ |
| 87 | 87 | return $c->query('ServerContainer')->getAvatarManager(); |
| 88 | 88 | }); |
| 89 | 89 | |
| 90 | - $container->registerService('Logger', function ($c) { |
|
| 90 | + $container->registerService('Logger', function($c) { |
|
| 91 | 91 | /** @var SimpleContainer $c */ |
| 92 | 92 | return $c->query('ServerContainer')->getLogger(); |
| 93 | 93 | }); |
| 94 | 94 | |
| 95 | - $container->registerService('L10N', function ($c) { |
|
| 95 | + $container->registerService('L10N', function($c) { |
|
| 96 | 96 | return $c->query('ServerContainer')->getL10N($c->query('AppName')); |
| 97 | 97 | }); |
| 98 | 98 | |
| 99 | - $container->registerService('CommentMapper', function ($c) use ($server) { |
|
| 99 | + $container->registerService('CommentMapper', function($c) use ($server) { |
|
| 100 | 100 | /** @var SimpleContainer $c */ |
| 101 | 101 | return new CommentMapper( |
| 102 | 102 | $server->getDatabaseConnection() |
| 103 | 103 | ); |
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | - $container->registerService('DateMapper', function ($c) use ($server) { |
|
| 106 | + $container->registerService('DateMapper', function($c) use ($server) { |
|
| 107 | 107 | /** @var SimpleContainer $c */ |
| 108 | 108 | return new DateMapper( |
| 109 | 109 | $server->getDatabaseConnection() |
| 110 | 110 | ); |
| 111 | 111 | }); |
| 112 | 112 | |
| 113 | - $container->registerService('EventMapper', function ($c) use ($server) { |
|
| 113 | + $container->registerService('EventMapper', function($c) use ($server) { |
|
| 114 | 114 | /** @var SimpleContainer $c */ |
| 115 | 115 | return new EventMapper( |
| 116 | 116 | $server->getDatabaseConnection() |
| 117 | 117 | ); |
| 118 | 118 | }); |
| 119 | 119 | |
| 120 | - $container->registerService('NotificationMapper', function ($c) use ($server) { |
|
| 120 | + $container->registerService('NotificationMapper', function($c) use ($server) { |
|
| 121 | 121 | /** @var SimpleContainer $c */ |
| 122 | 122 | return new NotificationMapper( |
| 123 | 123 | $server->getDatabaseConnection() |
| 124 | 124 | ); |
| 125 | 125 | }); |
| 126 | 126 | |
| 127 | - $container->registerService('ParticipationMapper', function ($c) use ($server) { |
|
| 127 | + $container->registerService('ParticipationMapper', function($c) use ($server) { |
|
| 128 | 128 | /** @var SimpleContainer $c */ |
| 129 | 129 | return new ParticipationMapper( |
| 130 | 130 | $server->getDatabaseConnection() |
| 131 | 131 | ); |
| 132 | 132 | }); |
| 133 | 133 | |
| 134 | - $container->registerService('ParticipationTextMapper', function ($c) use ($server) { |
|
| 134 | + $container->registerService('ParticipationTextMapper', function($c) use ($server) { |
|
| 135 | 135 | /** @var SimpleContainer $c */ |
| 136 | 136 | return new ParticipationTextMapper( |
| 137 | 137 | $server->getDatabaseConnection() |
| 138 | 138 | ); |
| 139 | 139 | }); |
| 140 | 140 | |
| 141 | - $container->registerService('TextMapper', function ($c) use ($server) { |
|
| 141 | + $container->registerService('TextMapper', function($c) use ($server) { |
|
| 142 | 142 | /** @var SimpleContainer $c */ |
| 143 | 143 | return new TextMapper( |
| 144 | 144 | $server->getDatabaseConnection() |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public function registerNavigationEntry() { |
| 153 | 153 | $container = $this->getContainer(); |
| 154 | - $container->query('OCP\INavigationManager')->add(function () use ($container) { |
|
| 154 | + $container->query('OCP\INavigationManager')->add(function() use ($container) { |
|
| 155 | 155 | $urlGenerator = $container->query('OCP\IURLGenerator'); |
| 156 | 156 | $l10n = $container->query('OCP\IL10N'); |
| 157 | 157 | return [ |
@@ -44,7 +44,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |