| @@ -25,7 +25,7 @@ | ||
| 25 | 25 |  	define('PHPUNIT_RUN', 1); | 
| 26 | 26 | } | 
| 27 | 27 | |
| 28 | -require_once(__DIR__.'/../../../lib/base.php'); | |
| 28 | +require_once(__DIR__ . '/../../../lib/base.php'); | |
| 29 | 29 | |
| 30 | 30 | // Fix for "Autoload path not allowed: .../tests/lib/testcase.php" | 
| 31 | 31 | \OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests'); | 
| @@ -27,18 +27,18 @@ discard block | ||
| 27 | 27 |  	\OCP\Util::addStyle('polls', 'vote'); | 
| 28 | 28 |  	\OCP\Util::addScript('polls', 'vote'); | 
| 29 | 29 | |
| 30 | - $userId = $_['userId']; | |
| 31 | - $userMgr = $_['userMgr']; | |
| 32 | - $urlGenerator = $_['urlGenerator']; | |
| 33 | - $avaMgr = $_['avatarManager']; | |
| 30 | + $userId = $_[ 'userId' ]; | |
| 31 | + $userMgr = $_[ 'userMgr' ]; | |
| 32 | + $urlGenerator = $_[ 'urlGenerator' ]; | |
| 33 | + $avaMgr = $_[ 'avatarManager' ]; | |
| 34 | 34 | |
| 35 | - $poll = $_['poll']; | |
| 36 | - $dates = $_['dates']; | |
| 37 | - $votes = $_['votes']; | |
| 38 | - $comments = $_['comments']; | |
| 35 | + $poll = $_[ 'poll' ]; | |
| 36 | + $dates = $_[ 'dates' ]; | |
| 37 | + $votes = $_[ 'votes' ]; | |
| 38 | + $comments = $_[ 'comments' ]; | |
| 39 | 39 | $isAnonymous = $poll->getIsAnonymous() && $userId != $poll->getOwner(); | 
| 40 | 40 | $hideNames = $poll->getIsAnonymous() && $poll->getFullAnonymous(); | 
| 41 | - $notification = $_['notification']; | |
| 41 | + $notification = $_[ 'notification' ]; | |
| 42 | 42 | |
| 43 | 43 |  	if ($poll->getExpire() == null) { | 
| 44 | 44 | $expired = false; | 
| @@ -47,14 +47,14 @@ discard block | ||
| 47 | 47 | } | 
| 48 | 48 | ?> | 
| 49 | 49 | |
| 50 | -<?php if($poll->getType() == '0') : ?> | |
| 51 | - <?php foreach($dates as $d) : ?> | |
| 50 | +<?php if ($poll->getType() == '0') : ?> | |
| 51 | + <?php foreach ($dates as $d) : ?> | |
| 52 | 52 | <input class="hidden-dates" type="hidden" value="<?php print_unescaped($d->getDt()); ?>" /> | 
| 53 | 53 | <?php endforeach ?> | 
| 54 | 54 | <?php endif ?> | 
| 55 | 55 | |
| 56 | 56 | <?php | 
| 57 | -if ( $poll->getDescription() != null | |
| 57 | +if ($poll->getDescription() != null | |
| 58 | 58 | && $poll->getDescription() != '' | 
| 59 | 59 |  ) { | 
| 60 | 60 | $description = nl2br($poll->getDescription()); | 
| @@ -65,13 +65,13 @@ discard block | ||
| 65 | 65 | // init array for counting 'yes'-votes for each date | 
| 66 | 66 | $total_y = array(); | 
| 67 | 67 | $total_n = array(); | 
| 68 | -for ($i = 0 ; $i < count($dates) ; $i++) { | |
| 69 | - $total_y[$i] = 0; | |
| 70 | - $total_n[$i] = 0; | |
| 68 | +for ($i = 0; $i < count($dates); $i++) { | |
| 69 | + $total_y[ $i ] = 0; | |
| 70 | + $total_n[ $i ] = 0; | |
| 71 | 71 | } | 
| 72 | 72 | $user_voted = array(); | 
| 73 | 73 | |
| 74 | -$pollUrl = $urlGenerator->linkToRouteAbsolute('polls.page.goto_poll', ['hash' => $poll->getHash()]); | |
| 74 | +$pollUrl = $urlGenerator->linkToRouteAbsolute('polls.page.goto_poll', [ 'hash' => $poll->getHash() ]); | |
| 75 | 75 | ?> | 
| 76 | 76 | |
| 77 | 77 | <div id="app"> | 
| @@ -123,10 +123,10 @@ discard block | ||
| 123 | 123 | //group by user | 
| 124 | 124 | $others = array(); | 
| 125 | 125 |  									foreach ($votes as $vote) { | 
| 126 | -										if (!isset($others[$vote->getUserId()])) { | |
| 127 | - $others[$vote->getUserId()] = array(); | |
| 126 | +										if (!isset($others[ $vote->getUserId() ])) { | |
| 127 | + $others[ $vote->getUserId() ] = array(); | |
| 128 | 128 | } | 
| 129 | - array_push($others[$vote->getUserId()], $vote); | |
| 129 | + array_push($others[ $vote->getUserId() ], $vote); | |
| 130 | 130 | } | 
| 131 | 131 | $userCnt = 0; | 
| 132 | 132 |  									foreach (array_keys($others) as $usr) { | 
| @@ -135,26 +135,26 @@ discard block | ||
| 135 | 135 | // if poll expired, just put current user among the others; | 
| 136 | 136 | // otherwise skip here to add current user as last row (to vote) | 
| 137 | 137 |  											if (!$expired) { | 
| 138 | - $user_voted = $others[$usr]; | |
| 138 | + $user_voted = $others[ $usr ]; | |
| 139 | 139 | continue; | 
| 140 | 140 | } | 
| 141 | 141 | } | 
| 142 | 142 |  										print_unescaped('<tr>'); | 
| 143 | 143 |  										print_unescaped('<td class="avatar-cell">'); | 
| 144 | - if ( $userMgr->get($usr) != null | |
| 144 | + if ($userMgr->get($usr) != null | |
| 145 | 145 | && !$isAnonymous && !$hideNames | 
| 146 | 146 |  										) { | 
| 147 | -											print_unescaped('<div class="poll avatardiv" title="'.($usr).'"></div>'); | |
| 147 | +											print_unescaped('<div class="poll avatardiv" title="' . ($usr) . '"></div>'); | |
| 148 | 148 |  											print_unescaped('</td>'); | 
| 149 | 149 |  											print_unescaped('<td colspan="2" class="name">'); | 
| 150 | 150 | p($userMgr->get($usr)->getDisplayName()); | 
| 151 | 151 |  										} else { | 
| 152 | 152 |  											if ($isAnonymous || $hideNames) { | 
| 153 | -											print_unescaped('<div class="poll avatardiv" title="'.($userCnt).'"></div>'); | |
| 153 | +											print_unescaped('<div class="poll avatardiv" title="' . ($userCnt) . '"></div>'); | |
| 154 | 154 |  											print_unescaped('</td>'); | 
| 155 | 155 |  											print_unescaped('<td colspan="2" class="name">'); | 
| 156 | 156 |  											} else { | 
| 157 | -												print_unescaped('<div class="poll avatardiv" title="'.($usr).'"></div>'); | |
| 157 | +												print_unescaped('<div class="poll avatardiv" title="' . ($usr) . '"></div>'); | |
| 158 | 158 |  												print_unescaped('</td>'); | 
| 159 | 159 |  												print_unescaped('<td colspan="2" class="name">'); | 
| 160 | 160 | p($usr); | 
| @@ -174,7 +174,7 @@ discard block | ||
| 174 | 174 | } | 
| 175 | 175 | // look what user voted for this dts | 
| 176 | 176 | $found = false; | 
| 177 | -											foreach ($others[$usr] as $vote) { | |
| 177 | +											foreach ($others[ $usr ] as $vote) { | |
| 178 | 178 | $voteVal = null; | 
| 179 | 179 |  												if ($poll->getType() == '0') { | 
| 180 | 180 | $voteVal = strtotime($vote->getDt()); | 
| @@ -184,10 +184,10 @@ discard block | ||
| 184 | 184 |  												if ($date_id == $voteVal) { | 
| 185 | 185 |  													if ($vote->getType() == '1') { | 
| 186 | 186 | $cl = 'poll-cell yes'; | 
| 187 | - $total_y[$i_tot]++; | |
| 187 | + $total_y[ $i_tot ]++; | |
| 188 | 188 |  													} else if ($vote->getType() == '0') { | 
| 189 | 189 | $cl = 'poll-cell no'; | 
| 190 | - $total_n[$i_tot]++; | |
| 190 | + $total_n[ $i_tot ]++; | |
| 191 | 191 |  													} else if ($vote->getType() == '2') { | 
| 192 | 192 | $cl = 'poll-cell maybe'; | 
| 193 | 193 |  													} else { | 
| @@ -215,7 +215,7 @@ discard block | ||
| 215 | 215 |  									print_unescaped('<tr class="current-user">'); | 
| 216 | 216 |  									print_unescaped('<td class="avatar-cell">'); | 
| 217 | 217 |  									if (User::isLoggedIn()) { | 
| 218 | -										print_unescaped('<div class="poll avatardiv" title="'.($userId).'"></div>'); | |
| 218 | +										print_unescaped('<div class="poll avatardiv" title="' . ($userId) . '"></div>'); | |
| 219 | 219 |  										print_unescaped('</td>'); | 
| 220 | 220 |  										print_unescaped('<td class="name">'); | 
| 221 | 221 | p($userMgr->get($userId)->getDisplayName()); | 
| @@ -240,7 +240,7 @@ discard block | ||
| 240 | 240 |  										if (isset($user_voted)) { | 
| 241 | 241 |  											foreach ($user_voted as $obj) { | 
| 242 | 242 | $voteVal = null; | 
| 243 | -												if($poll->getType() == '0') { | |
| 243 | +												if ($poll->getType() == '0') { | |
| 244 | 244 | $voteVal = strtotime($obj->getDt()); | 
| 245 | 245 |  												} else { | 
| 246 | 246 | $voteVal = $obj->getText(); | 
| @@ -248,11 +248,11 @@ discard block | ||
| 248 | 248 |  												if ($voteVal == $date_id) { | 
| 249 | 249 |  													if ($obj->getType() == '1') { | 
| 250 | 250 | $cl = 'poll-cell active yes'; | 
| 251 | - $total_y[$i_tot]++; | |
| 251 | + $total_y[ $i_tot ]++; | |
| 252 | 252 |  													} else if ($obj->getType() == '0') { | 
| 253 | 253 | $cl = 'poll-cell active no'; | 
| 254 | - $total_n[$i_tot]++; | |
| 255 | -													} else if($obj->getType() == '2') { | |
| 254 | + $total_n[ $i_tot ]++; | |
| 255 | +													} else if ($obj->getType() == '2') { | |
| 256 | 256 | $cl = 'poll-cell active maybe'; | 
| 257 | 257 | } | 
| 258 | 258 | break; | 
| @@ -272,28 +272,28 @@ discard block | ||
| 272 | 272 | <tbody class="summary"> | 
| 273 | 273 | <?php | 
| 274 | 274 | $diff_array = $total_y; | 
| 275 | -									for($i = 0 ; $i < count($diff_array) ; $i++) { | |
| 276 | - $diff_array[$i] = ($total_y[$i] - $total_n[$i]); | |
| 275 | +									for ($i = 0; $i < count($diff_array); $i++) { | |
| 276 | + $diff_array[ $i ] = ($total_y[ $i ] - $total_n[ $i ]); | |
| 277 | 277 | } | 
| 278 | 278 | $max_votes = max($diff_array); | 
| 279 | 279 | ?> | 
| 280 | 280 | <tr class="total"> | 
| 281 | 281 |  									<th colspan="3"><?php p($l->t('Total')); ?></th> | 
| 282 | - <?php for ($i = 0 ; $i < count($dates) ; $i++) : ?> | |
| 282 | + <?php for ($i = 0; $i < count($dates); $i++) : ?> | |
| 283 | 283 | <td class="total"> | 
| 284 | 284 | <?php | 
| 285 | - $classSuffix = "pollid_" . $dates[$i]->getId(); | |
| 286 | -											if (isset($total_y[$i])) { | |
| 287 | - $val = $total_y[$i]; | |
| 285 | + $classSuffix = "pollid_" . $dates[ $i ]->getId(); | |
| 286 | +											if (isset($total_y[ $i ])) { | |
| 287 | + $val = $total_y[ $i ]; | |
| 288 | 288 |  											} else { | 
| 289 | 289 | $val = 0; | 
| 290 | 290 | } | 
| 291 | 291 | ?> | 
| 292 | - <div id="id_y_<?php p($classSuffix); ?>" class="result-cell yes" data-value=<?php p(isset($total_y_others[$i]) ? $total_y_others[$i] : '0'); ?>> | |
| 292 | + <div id="id_y_<?php p($classSuffix); ?>" class="result-cell yes" data-value=<?php p(isset($total_y_others[ $i ]) ? $total_y_others[ $i ] : '0'); ?>> | |
| 293 | 293 | <?php p($val); ?> | 
| 294 | 294 | </div> | 
| 295 | - <div id="id_n_<?php p($classSuffix); ?>" class="result-cell no" data-value=<?php p(isset($total_n_others[$i]) ? $total_n_others[$i] : '0'); ?>> | |
| 296 | - <?php p(isset($total_n[$i]) ? $total_n[$i] : '0'); ?> | |
| 295 | + <div id="id_n_<?php p($classSuffix); ?>" class="result-cell no" data-value=<?php p(isset($total_n_others[ $i ]) ? $total_n_others[ $i ] : '0'); ?>> | |
| 296 | + <?php p(isset($total_n[ $i ]) ? $total_n[ $i ] : '0'); ?> | |
| 297 | 297 | </div> | 
| 298 | 298 | </td> | 
| 299 | 299 | <?php endfor; ?> | 
| @@ -303,7 +303,7 @@ discard block | ||
| 303 | 303 | <?php | 
| 304 | 304 |  									for ($i = 0; $i < count($dates); $i++) { | 
| 305 | 305 | $check = ''; | 
| 306 | -										if ($total_y[$i] - $total_n[$i] == $max_votes) { | |
| 306 | +										if ($total_y[ $i ] - $total_n[ $i ] == $max_votes) { | |
| 307 | 307 | $check = 'icon-checkmark'; | 
| 308 | 308 | } | 
| 309 | 309 |  										print_unescaped('<td class="win_row ' . $check . '" id="id_total_' . $i . '"></td>'); | 
| @@ -334,7 +334,7 @@ discard block | ||
| 334 | 334 | <div class="input-group-addon"> | 
| 335 | 335 |  							<span class="icon-share"></span><?php p($l->t('Link')); ?> | 
| 336 | 336 | </div> | 
| 337 | - <input type="text" value="<?php p($pollUrl);?>" readonly="readonly"> | |
| 337 | + <input type="text" value="<?php p($pollUrl); ?>" readonly="readonly"> | |
| 338 | 338 | </div> | 
| 339 | 339 | <?php if ($expired) : ?> | 
| 340 | 340 | <div id="expired_info"> | 
| @@ -27,18 +27,18 @@ 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']; | |
| 31 | - $userMgr = $_['userMgr']; | |
| 32 | - $urlGenerator = $_['urlGenerator']; | |
| 33 | - $isUpdate = isset($_['poll']) && $_['poll'] != null; | |
| 30 | + $userId = $_[ 'userId' ]; | |
| 31 | + $userMgr = $_[ 'userMgr' ]; | |
| 32 | + $urlGenerator = $_[ 'urlGenerator' ]; | |
| 33 | + $isUpdate = isset($_[ 'poll' ]) && $_[ 'poll' ] != null; | |
| 34 | 34 | $isAnonymous = false; | 
| 35 | 35 | $hideNames = false; | 
| 36 | 36 | |
| 37 | 37 |  	if ($isUpdate) { | 
| 38 | - $poll = $_['poll']; | |
| 38 | + $poll = $_[ 'poll' ]; | |
| 39 | 39 | $isAnonymous = $poll->getIsAnonymous(); | 
| 40 | 40 | $hideNames = $isAnonymous && $poll->getFullAnonymous(); | 
| 41 | - $dates = $_['dates']; | |
| 41 | + $dates = $_[ 'dates' ]; | |
| 42 | 42 | $chosen = '['; | 
| 43 | 43 |  		foreach ($dates as $d) { | 
| 44 | 44 |  			if ($poll->getType() == '0') { | 
| @@ -53,12 +53,12 @@ discard block | ||
| 53 | 53 | $title = $poll->getTitle(); | 
| 54 | 54 | $desc = $poll->getDescription(); | 
| 55 | 55 |  		if ($poll->getExpire() != null) { | 
| 56 | - $expireTs = strtotime($poll->getExpire()) - 60*60*24; //remove one day, which has been added to expire at the end of a day | |
| 56 | + $expireTs = strtotime($poll->getExpire()) - 60 * 60 * 24; //remove one day, which has been added to expire at the end of a day | |
| 57 | 57 |  			$expireStr = date('d.m.Y', $expireTs); | 
| 58 | 58 | } | 
| 59 | 59 | $access = $poll->getAccess(); | 
| 60 | 60 | $accessTypes = $access; | 
| 61 | - if ( $access != 'registered' | |
| 61 | + if ($access != 'registered' | |
| 62 | 62 | && $access != 'hidden' && $access != 'public' | 
| 63 | 63 |  		) { | 
| 64 | 64 | $access = 'select'; | 
| @@ -166,7 +166,7 @@ discard block | ||
| 166 | 166 | <table id="selected-dates-table" class="choices"> | 
| 167 | 167 | </table> | 
| 168 | 168 | </div> | 
| 169 | -						<div id="text-select-container" <?php if(!$isUpdate || $poll->getType() == '0') print_unescaped('style="display:none;"'); ?> > | |
| 169 | +						<div id="text-select-container" <?php if (!$isUpdate || $poll->getType() == '0') print_unescaped('style="display:none;"'); ?> > | |
| 170 | 170 |  							<label for="text-title" class="input_title"><?php p($l->t('Text item')); ?></label> | 
| 171 | 171 | <div class="input-group"> | 
| 172 | 172 |  								<input type="text" id="text-title" placeholder="<?php print_unescaped('Insert text...'); ?>" /> | 
| @@ -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 | } |