@@ -34,6 +34,6 @@ |
||
| 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 | } |
@@ -28,7 +28,7 @@ |
||
| 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 | }, |
@@ -28,7 +28,7 @@ |
||
| 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 | }, |
@@ -25,7 +25,7 @@ |
||
| 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 | } |
@@ -85,8 +85,11 @@ discard block |
||
| 85 | 85 | <span> |
| 86 | 86 | <?php if ($isUpdate): ?> |
| 87 | 87 | <?php p($l->t('Edit poll') . ' ' . $poll->getTitle()); ?> |
| 88 | - <?php else: ?> |
|
| 89 | - <?php p($l->t('Create new poll')); ?> |
|
| 88 | + <?php else { |
|
| 89 | + : ?> |
|
| 90 | + <?php p($l->t('Create new poll')); |
|
| 91 | +} |
|
| 92 | +?> |
|
| 90 | 93 | <?php endif; ?> |
| 91 | 94 | </span> |
| 92 | 95 | </div> |
@@ -96,11 +99,20 @@ discard block |
||
| 96 | 99 | <?php if ($isUpdate): ?> |
| 97 | 100 | <form name="finish_poll" action="<?php p($urlGenerator->linkToRoute('polls.page.update_poll')); ?>" method="POST"> |
| 98 | 101 | <input type="hidden" name="pollId" value="<?php p($poll->getId()); ?>" /> |
| 99 | - <?php else: ?> |
|
| 100 | - <form name="finish_poll" action="<?php p($urlGenerator->linkToRoute('polls.page.insert_poll')); ?>" method="POST"> |
|
| 102 | + <?php else { |
|
| 103 | + : ?> |
|
| 104 | + <form name="finish_poll" action="<?php p($urlGenerator->linkToRoute('polls.page.insert_poll')); |
|
| 105 | +} |
|
| 106 | +?>" method="POST"> |
|
| 101 | 107 | <?php endif; ?> |
| 102 | - <input type="hidden" name="chosenDates" id="chosenDates" value="<?php if (isset($chosen)) p($chosen); ?>" /> |
|
| 103 | - <input type="hidden" name="expireTs" id="expireTs" value="<?php if (isset($expireTs)) p($expireTs); ?>" /> |
|
| 108 | + <input type="hidden" name="chosenDates" id="chosenDates" value="<?php if (isset($chosen)) { |
|
| 109 | + p($chosen); |
|
| 110 | +} |
|
| 111 | +?>" /> |
|
| 112 | + <input type="hidden" name="expireTs" id="expireTs" value="<?php if (isset($expireTs)) { |
|
| 113 | + p($expireTs); |
|
| 114 | +} |
|
| 115 | +?>" /> |
|
| 104 | 116 | <input type="hidden" name="userId" id="userId" value="<?php p($userId); ?>" /> |
| 105 | 117 | |
| 106 | 118 | <header class="row"> |
@@ -109,22 +121,40 @@ discard block |
||
| 109 | 121 | <div class="new_poll row"> |
| 110 | 122 | <div class="col-50"> |
| 111 | 123 | <label for="pollTitle" class="input_title"><?php p($l->t('Title')); ?></label> |
| 112 | - <input type="text" class="input_field" id="pollTitle" name="pollTitle" value="<?php if (isset($title)) p($title); ?>" /> |
|
| 124 | + <input type="text" class="input_field" id="pollTitle" name="pollTitle" value="<?php if (isset($title)) { |
|
| 125 | + p($title); |
|
| 126 | +} |
|
| 127 | +?>" /> |
|
| 113 | 128 | <label for="pollDesc" class="input_title"><?php p($l->t('Description')); ?></label> |
| 114 | - <textarea class="input_field" id="pollDesc" name="pollDesc"><?php if (isset($desc)) p($desc); ?></textarea> |
|
| 129 | + <textarea class="input_field" id="pollDesc" name="pollDesc"><?php if (isset($desc)) { |
|
| 130 | + p($desc); |
|
| 131 | +} |
|
| 132 | +?></textarea> |
|
| 115 | 133 | |
| 116 | 134 | <label class="input_title"><?php p($l->t('Access')); ?></label> |
| 117 | 135 | |
| 118 | - <input type="radio" name="accessType" id="private" value="registered" class="radio" <?php if (!$isUpdate || $access === 'registered') print_unescaped('checked'); ?> /> |
|
| 136 | + <input type="radio" name="accessType" id="private" value="registered" class="radio" <?php if (!$isUpdate || $access === 'registered') { |
|
| 137 | + print_unescaped('checked'); |
|
| 138 | +} |
|
| 139 | +?> /> |
|
| 119 | 140 | <label for="private"><?php p($l->t('Registered users only')); ?></label> |
| 120 | 141 | |
| 121 | - <input type="radio" name="accessType" id="hidden" value="hidden" class="radio" <?php if ($isUpdate && $access === 'hidden') print_unescaped('checked'); ?> /> |
|
| 142 | + <input type="radio" name="accessType" id="hidden" value="hidden" class="radio" <?php if ($isUpdate && $access === 'hidden') { |
|
| 143 | + print_unescaped('checked'); |
|
| 144 | +} |
|
| 145 | +?> /> |
|
| 122 | 146 | <label for="hidden"><?php p($l->t('hidden')); ?></label> |
| 123 | 147 | |
| 124 | - <input type="radio" name="accessType" id="public" value="public" class="radio" <?php if ($isUpdate && $access === 'public') print_unescaped('checked'); ?> /> |
|
| 148 | + <input type="radio" name="accessType" id="public" value="public" class="radio" <?php if ($isUpdate && $access === 'public') { |
|
| 149 | + print_unescaped('checked'); |
|
| 150 | +} |
|
| 151 | +?> /> |
|
| 125 | 152 | <label for="public"><?php p($l->t('Public access')); ?></label> |
| 126 | 153 | |
| 127 | - <input type="radio" name="accessType" id="select" value="select" class="radio" <?php if ($isUpdate && $access === 'select') print_unescaped('checked'); ?>> |
|
| 154 | + <input type="radio" name="accessType" id="select" value="select" class="radio" <?php if ($isUpdate && $access === 'select') { |
|
| 155 | + print_unescaped('checked'); |
|
| 156 | +} |
|
| 157 | +?>> |
|
| 128 | 158 | <label for="select"><?php p($l->t('Select')); ?></label> |
| 129 | 159 | <span id="id_label_select">...</span> |
| 130 | 160 | |
@@ -140,9 +170,12 @@ discard block |
||
| 140 | 170 | </div> |
| 141 | 171 | </div> |
| 142 | 172 | |
| 143 | - <input type="hidden" name="accessValues" id="accessValues" value="<?php if ($isUpdate && $access === 'select') p($accessTypes) ?>" /> |
|
| 173 | + <input type="hidden" name="accessValues" id="accessValues" value="<?php if ($isUpdate && $access === 'select') { |
|
| 174 | + p($accessTypes) ?>" /> |
|
| 144 | 175 | |
| 145 | - <input id="isAnonymous" name="isAnonymous" type="checkbox" class="checkbox" <?php $isAnonymous ? print_unescaped('value="true" checked') : print_unescaped('value="false"'); ?> /> |
|
| 176 | + <input id="isAnonymous" name="isAnonymous" type="checkbox" class="checkbox" <?php $isAnonymous ? print_unescaped('value="true" checked') : print_unescaped('value="false"'); |
|
| 177 | +} |
|
| 178 | +?> /> |
|
| 146 | 179 | <label for="isAnonymous" class="input_title"><?php p($l->t('Anonymous')) ?></label> |
| 147 | 180 | |
| 148 | 181 | <div id="anonOptions" style="display:none;"> |
@@ -158,20 +191,32 @@ discard block |
||
| 158 | 191 | </div> |
| 159 | 192 | <div class="col-50"> |
| 160 | 193 | |
| 161 | - <input type="radio" name="pollType" id="event" value="event" class="radio" <?php if (!$isUpdate || $poll->getType() === 0) print_unescaped('checked'); ?> /> |
|
| 194 | + <input type="radio" name="pollType" id="event" value="event" class="radio" <?php if (!$isUpdate || $poll->getType() === 0) { |
|
| 195 | + print_unescaped('checked'); |
|
| 196 | +} |
|
| 197 | +?> /> |
|
| 162 | 198 | <label for="event"><?php p($l->t('Event schedule')); ?></label> |
| 163 | 199 | |
| 164 | 200 | <!-- TODO texts to db --> |
| 165 | - <input type="radio" name="pollType" id="text" value="text" class="radio" <?php if ($isUpdate && $poll->getType() === 1) print_unescaped('checked'); ?>> |
|
| 201 | + <input type="radio" name="pollType" id="text" value="text" class="radio" <?php if ($isUpdate && $poll->getType() === 1) { |
|
| 202 | + print_unescaped('checked'); |
|
| 203 | +} |
|
| 204 | +?>> |
|
| 166 | 205 | <label for="text"><?php p($l->t('Text based')); ?></label> |
| 167 | 206 | |
| 168 | - <div id="date-select-container" <?php if ($isUpdate && $poll->getType() === 1) print_unescaped('style="display:none;"'); ?> > |
|
| 207 | + <div id="date-select-container" <?php if ($isUpdate && $poll->getType() === 1) { |
|
| 208 | + print_unescaped('style="display:none;"'); |
|
| 209 | +} |
|
| 210 | +?> > |
|
| 169 | 211 | <label for="datetimepicker" class="input_title"><?php p($l->t('Dates')); ?></label> |
| 170 | 212 | <input id="datetimepicker" type="text" /> |
| 171 | 213 | <table id="selected-dates-table" class="choices"> |
| 172 | 214 | </table> |
| 173 | 215 | </div> |
| 174 | - <div id="text-select-container" <?php if(!$isUpdate || $poll->getType() === 0) print_unescaped('style="display:none;"'); ?> > |
|
| 216 | + <div id="text-select-container" <?php if(!$isUpdate || $poll->getType() === 0) { |
|
| 217 | + print_unescaped('style="display:none;"'); |
|
| 218 | +} |
|
| 219 | +?> > |
|
| 175 | 220 | <label for="text-title" class="input_title"><?php p($l->t('Text item')); ?></label> |
| 176 | 221 | <div class="input-group"> |
| 177 | 222 | <input type="text" id="text-title" placeholder="<?php print_unescaped('Insert text...'); ?>" /> |
@@ -187,8 +232,11 @@ discard block |
||
| 187 | 232 | <div class="form-actions"> |
| 188 | 233 | <?php if ($isUpdate): ?> |
| 189 | 234 | <input type="submit" id="submit_finish_poll" class="button btn primary" value="<?php p($l->t('Update poll')); ?>" /> |
| 190 | - <?php else: ?> |
|
| 191 | - <input type="submit" id="submit_finish_poll" class="button btn primary" value="<?php p($l->t('Create poll')); ?>" /> |
|
| 235 | + <?php else { |
|
| 236 | + : ?> |
|
| 237 | + <input type="submit" id="submit_finish_poll" class="button btn primary" value="<?php p($l->t('Create poll')); |
|
| 238 | +} |
|
| 239 | +?>" /> |
|
| 192 | 240 | <?php endif; ?> |
| 193 | 241 | <a href="<?php p($urlGenerator->linkToRoute('polls.page.index')); ?>" id="submit_cancel_poll" class="button"><?php p($l->t('Cancel')); ?></a> |
| 194 | 242 | </div> |
@@ -27,22 +27,22 @@ discard block |
||
| 27 | 27 | \OCP\Util::addScript('polls', 'create_edit'); |
| 28 | 28 | \OCP\Util::addScript('polls', 'vendor/jquery.datetimepicker.full.min'); |
| 29 | 29 | |
| 30 | - $userId = $_['userId']; |
|
| 30 | + $userId = $_[ 'userId' ]; |
|
| 31 | 31 | /** @var \OCP\IUserManager $userMgr */ |
| 32 | - $userMgr = $_['userMgr']; |
|
| 32 | + $userMgr = $_[ 'userMgr' ]; |
|
| 33 | 33 | /** @var \OCP\IURLGenerator $urlGenerator */ |
| 34 | - $urlGenerator = $_['urlGenerator']; |
|
| 35 | - $isUpdate = isset($_['poll']) && $_['poll'] !== null; |
|
| 34 | + $urlGenerator = $_[ 'urlGenerator' ]; |
|
| 35 | + $isUpdate = isset($_[ 'poll' ]) && $_[ 'poll' ] !== null; |
|
| 36 | 36 | $isAnonymous = false; |
| 37 | 37 | $hideNames = false; |
| 38 | 38 | |
| 39 | 39 | if ($isUpdate) { |
| 40 | 40 | /** @var OCA\Polls\Db\Event $poll */ |
| 41 | - $poll = $_['poll']; |
|
| 41 | + $poll = $_[ 'poll' ]; |
|
| 42 | 42 | $isAnonymous = $poll->getIsAnonymous(); |
| 43 | 43 | $hideNames = $isAnonymous && $poll->getFullAnonymous(); |
| 44 | 44 | /** @var OCA\Polls\Db\Date[]|OCA\Polls\Db\Text[] $dates */ |
| 45 | - $dates = $_['dates']; |
|
| 45 | + $dates = $_[ 'dates' ]; |
|
| 46 | 46 | $chosen = '['; |
| 47 | 47 | foreach ($dates as $d) { |
| 48 | 48 | if ($poll->getType() === 0) { |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | <table id="selected-dates-table" class="choices"> |
| 172 | 172 | </table> |
| 173 | 173 | </div> |
| 174 | - <div id="text-select-container" <?php if(!$isUpdate || $poll->getType() === 0) print_unescaped('style="display:none;"'); ?> > |
|
| 174 | + <div id="text-select-container" <?php if (!$isUpdate || $poll->getType() === 0) print_unescaped('style="display:none;"'); ?> > |
|
| 175 | 175 | <label for="text-title" class="input_title"><?php p($l->t('Text item')); ?></label> |
| 176 | 176 | <div class="input-group"> |
| 177 | 177 | <input type="text" id="text-title" placeholder="<?php print_unescaped('Insert text...'); ?>" /> |
@@ -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 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -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 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -31,12 +31,12 @@ |
||
| 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 | }, |