@@ -166,22 +166,22 @@ |
||
166 | 166 | |
167 | 167 | $tpl->assign('showdetails', true); |
168 | 168 | |
169 | - $r['hidden'] = (int) $connection->fetchOne( |
|
169 | + $r['hidden'] = (int)$connection->fetchOne( |
|
170 | 170 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`=:userId', ['userId' => $r['user_id']] |
171 | 171 | ); |
172 | - $r['hidden_active'] = (int) $connection->fetchOne( |
|
172 | + $r['hidden_active'] = (int)$connection->fetchOne( |
|
173 | 173 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`= :userId AND `status`=1', |
174 | 174 | ['userId' => $r['user_id']] |
175 | 175 | ); |
176 | - $r['logentries'] = (int) $connection->fetchOne( |
|
176 | + $r['logentries'] = (int)$connection->fetchOne( |
|
177 | 177 | 'SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`= :userId', |
178 | 178 | ['userId' => $r['user_id']] |
179 | 179 | ); |
180 | - $r['deleted_logentries'] = (int) $connection->fetchOne( |
|
180 | + $r['deleted_logentries'] = (int)$connection->fetchOne( |
|
181 | 181 | 'SELECT COUNT(*) FROM `cache_logs_archived` WHERE `user_id`= :userId', |
182 | 182 | ['userId' => $r['user_id']] |
183 | 183 | ); |
184 | - $r['reports'] = (int) $connection->fetchOne( |
|
184 | + $r['reports'] = (int)$connection->fetchOne( |
|
185 | 185 | 'SELECT COUNT(*) FROM `cache_reports` WHERE `userid`= :userId', |
186 | 186 | ['userId' => $r['user_id']] |
187 | 187 | ); |
@@ -28,14 +28,14 @@ |
||
28 | 28 | ['wp' => $_REQUEST['wp']] |
29 | 29 | ); |
30 | 30 | } else { |
31 | - $cacheId = isset($_REQUEST['cacheid']) ? (int) $_REQUEST['cacheid'] : -1; |
|
31 | + $cacheId = isset($_REQUEST['cacheid']) ? (int)$_REQUEST['cacheid'] : -1; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $showHistory = false; |
35 | 35 | $error = ''; |
36 | 36 | |
37 | 37 | if ($cacheId >= 0 && |
38 | - $connection->fetchOne('SELECT COUNT(*) FROM `caches` WHERE `cache_id`=:id',['id' => $cacheId]) <> 1) |
|
38 | + $connection->fetchOne('SELECT COUNT(*) FROM `caches` WHERE `cache_id`=:id', ['id' => $cacheId]) <> 1) |
|
39 | 39 | { |
40 | 40 | $error = $translate->t('Cache not found', '', '', 0); |
41 | 41 | } elseif ($cacheId > 0) { |
@@ -13,10 +13,10 @@ |
||
13 | 13 | $tpl->name = 'usertops'; |
14 | 14 | $tpl->menuitem = MNU_CACHES_USERTOPS; |
15 | 15 | |
16 | -$userId = (int) isset($_REQUEST['userid']) ? $_REQUEST['userid']: 0; |
|
16 | +$userId = (int)isset($_REQUEST['userid']) ? $_REQUEST['userid'] : 0; |
|
17 | 17 | $ocOnly = isset($_REQUEST['oconly']) && $_REQUEST['oconly']; |
18 | 18 | |
19 | -$sUsername = $connection->fetchOne('SELECT `username` FROM `user` WHERE `user_id` = :userId',['userId' => $userId]); |
|
19 | +$sUsername = $connection->fetchOne('SELECT `username` FROM `user` WHERE `user_id` = :userId', ['userId' => $userId]); |
|
20 | 20 | if ($sUsername == null) { |
21 | 21 | $tpl->error(ERROR_USER_NOT_EXISTS); |
22 | 22 | } |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | // current cache and log-counters |
76 | 76 | $tpl->assign( |
77 | 77 | 'count_hiddens', |
78 | - number1000((int) $connection->fetchOne('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status` = 1')) |
|
78 | + number1000((int)$connection->fetchOne('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status` = 1')) |
|
79 | 79 | ); |
80 | 80 | $tpl->assign( |
81 | 81 | 'count_founds', |
82 | - number1000((int) $connection->fetchOne('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type` = 1')) |
|
82 | + number1000((int)$connection->fetchOne('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type` = 1')) |
|
83 | 83 | ); |
84 | 84 | $tpl->assign( |
85 | 85 | 'count_users', |
86 | 86 | number1000( |
87 | - (int) $connection->fetchOne( |
|
87 | + (int)$connection->fetchOne( |
|
88 | 88 | 'SELECT COUNT(*) AS `users` |
89 | 89 | FROM ( |
90 | 90 | SELECT DISTINCT `user_id` |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | // get total event count for all countries |
103 | 103 | $tpl->assign( |
104 | 104 | 'total_events', |
105 | - (int) $connection->fetchOne( |
|
105 | + (int)$connection->fetchOne( |
|
106 | 106 | 'SELECT COUNT(*) |
107 | 107 | FROM `caches` |
108 | 108 | WHERE `type` = 6 |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | WHERE cache_id = :cacheId; |
228 | 228 | SQL |
229 | 229 | , [ |
230 | - 'cacheId' => (int) $cache['cache_id'], |
|
230 | + 'cacheId' => (int)$cache['cache_id'], |
|
231 | 231 | ]); |
232 | 232 | |
233 | 233 | $this->connection->executeQuery(<<<'SQL' |
@@ -239,19 +239,19 @@ discard block |
||
239 | 239 | WHERE cache_id = :cacheId |
240 | 240 | SQL |
241 | 241 | , [ |
242 | - 'cacheId' => (int) $cache['cache_id'], |
|
242 | + 'cacheId' => (int)$cache['cache_id'], |
|
243 | 243 | ]); |
244 | 244 | |
245 | 245 | $this->connection->executeQuery('DELETE FROM cache_desc_modified WHERE cache_id = :cacheId', [ |
246 | - 'cacheId' => (int) $cache['cache_id'], |
|
246 | + 'cacheId' => (int)$cache['cache_id'], |
|
247 | 247 | ]); |
248 | 248 | |
249 | 249 | $this->connection->executeQuery('DELETE FROM cache_ignore WHERE cache_id = :cacheId', [ |
250 | - 'cacheId' => (int) $cache['cache_id'], |
|
250 | + 'cacheId' => (int)$cache['cache_id'], |
|
251 | 251 | ]); |
252 | 252 | |
253 | 253 | $this->connection->executeQuery('DELETE FROM caches_modified WHERE cache_id = :cacheId', [ |
254 | - 'cacheId' => (int) $cache['cache_id'], |
|
254 | + 'cacheId' => (int)$cache['cache_id'], |
|
255 | 255 | ]); |
256 | 256 | } |
257 | 257 | } |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | return []; |
266 | 266 | } |
267 | 267 | |
268 | - $ids = array_map(static function (array $cache) use ($idField) { |
|
269 | - return (int) $cache[$idField]; |
|
268 | + $ids = array_map(static function(array $cache) use ($idField) { |
|
269 | + return (int)$cache[$idField]; |
|
270 | 270 | }, $data); |
271 | 271 | |
272 | 272 | $pictures = $this->connection->fetchAllAssociative('SELECT * FROM pictures WHERE object_id IN (' . implode(',', $ids) . ') AND object_type = :objectType', [ |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | return []; |
287 | 287 | } |
288 | 288 | |
289 | - $ids = array_map(static function (array $cache) use ($idField) { |
|
290 | - return (int) $cache[$idField]; |
|
289 | + $ids = array_map(static function(array $cache) use ($idField) { |
|
290 | + return (int)$cache[$idField]; |
|
291 | 291 | }, $data); |
292 | 292 | |
293 | 293 | return $this->connection->fetchAllAssociative('SELECT * FROM pictures_modified WHERE object_id IN (' . implode(',', $ids) . ') AND object_type = :objectType', [ |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | |
593 | 593 | // ok ... redirect the get-data |
594 | 594 | $target = ($opt['page']['https']['force_login'] ? 'https' : $opt['page']['protocol']) |
595 | - . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
|
595 | + . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
|
596 | 596 | $this->redirect('login.php?target=' . urlencode($target)); |
597 | 597 | } |
598 | 598 | |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | $this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))'; |
739 | 739 | $this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]'; |
740 | 740 | $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp |
741 | - . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?'; |
|
741 | + . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?'; |
|
742 | 742 | $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp; |
743 | 743 | |
744 | 744 | // matches config vars: |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | |
753 | 753 | // matches all valid variables (no quotes, no modifiers) |
754 | 754 | $this->_avar_regexp = '(?:' . $this->_dvar_regexp . '|' |
755 | - . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')'; |
|
755 | + . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')'; |
|
756 | 756 | |
757 | 757 | // matches valid variable syntax: |
758 | 758 | // $foo |
@@ -776,10 +776,10 @@ discard block |
||
776 | 776 | // $foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar)) |
777 | 777 | $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')'; |
778 | 778 | $this->_obj_restricted_param_regexp = '(?:' |
779 | - . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')' |
|
780 | - . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)'; |
|
779 | + . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')' |
|
780 | + . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)'; |
|
781 | 781 | $this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|' |
782 | - . $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)'; |
|
782 | + . $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)'; |
|
783 | 783 | $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp |
784 | 784 | . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)'; |
785 | 785 | $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)'; |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | // |foo|bar |
795 | 795 | // |foo:$foo->bar |
796 | 796 | $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|' |
797 | - . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)'; |
|
797 | + . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)'; |
|
798 | 798 | |
799 | 799 | // matches valid function name: |
800 | 800 | // foo123 |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | // "text"|bar |
816 | 816 | // $foo->bar |
817 | 817 | $this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|' |
818 | - . $this->_var_regexp . '|' . $this->_num_const_regexp . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)'; |
|
818 | + . $this->_var_regexp . '|' . $this->_num_const_regexp . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)'; |
|
819 | 819 | |
820 | 820 | // matches valid parenthesised function parameters: |
821 | 821 | // |
@@ -823,8 +823,8 @@ discard block |
||
823 | 823 | // $foo, $bar, "text" |
824 | 824 | // $foo|bar, "foo"|bar, $foo->bar($foo)|bar |
825 | 825 | $this->_parenth_param_regexp = '(?:\((?:\w+|' |
826 | - . $this->_param_regexp . '(?:\s*,\s*(?:(?:\w+|' |
|
827 | - . $this->_param_regexp . ')))*)?\))'; |
|
826 | + . $this->_param_regexp . '(?:\s*,\s*(?:(?:\w+|' |
|
827 | + . $this->_param_regexp . ')))*)?\))'; |
|
828 | 828 | |
829 | 829 | // matches valid function call: |
830 | 830 | // foo() |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | public $compile_id = null; |
54 | 54 | |
55 | - public $cache_id = null; // This is a smarty caching ID, not a caches.cache_id. |
|
55 | + public $cache_id = null; // This is a smarty caching ID, not a caches.cache_id. |
|
56 | 56 | |
57 | 57 | public string $title = ''; |
58 | 58 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | |
493 | 493 | $args = func_get_args(); |
494 | 494 | unset($args[0]); |
495 | - for ($i = 1; isset($args[$i]); $i ++) { |
|
495 | + for ($i = 1; isset($args[$i]); $i++) { |
|
496 | 496 | $this->assign('p' . $i, $args[$i]); |
497 | 497 | } |
498 | 498 | |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | // |foo|bar |
795 | 795 | // |foo:$foo->bar |
796 | 796 | $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|' |
797 | - . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)'; |
|
797 | + . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp . '))*)'; |
|
798 | 798 | |
799 | 799 | // matches valid function name: |
800 | 800 | // foo123 |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | // "text"|bar |
816 | 816 | // $foo->bar |
817 | 817 | $this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|' |
818 | - . $this->_var_regexp . '|' . $this->_num_const_regexp . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)'; |
|
818 | + . $this->_var_regexp . '|' . $this->_num_const_regexp . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)'; |
|
819 | 819 | |
820 | 820 | // matches valid parenthesised function parameters: |
821 | 821 | // |
@@ -137,7 +137,7 @@ |
||
137 | 137 | $records[] = $this->getEntityFromDatabaseArray($item); |
138 | 138 | } |
139 | 139 | |
140 | - return array_map(static function ($role) { |
|
140 | + return array_map(static function($role) { |
|
141 | 141 | return $role->role; |
142 | 142 | }, $records); |
143 | 143 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | // https://symfonycasts.com/screencast/symfony6-upgrade/custom-authenticator |
55 | 55 | return new Passport( |
56 | - new UserBadge($userName, function ($userIdentifier) { |
|
56 | + new UserBadge($userName, function($userIdentifier) { |
|
57 | 57 | // optionally pass a callback to load the User manually |
58 | 58 | $user = $this->userRepository->fetchOneBy(['username' => $userIdentifier]); |
59 | 59 | if (!$user) { |
@@ -323,7 +323,7 @@ |
||
323 | 323 | $entity->logType = $this->logTypesRepository->fetchOneBy(['id' => $entity->type]); |
324 | 324 | $entity->user = $this->userRepository->fetchOneById($entity->userId); |
325 | 325 | $entity->pictures = $this->picturesRepository->fetchBy(['object_id' => $entity->id, 'object_type' => 1]); |
326 | - $entity->ratingCacheLog = $this->cacheRatingRepository->getRatingUserCache(['cache_id' => $entity->cacheId, 'user_id' => $entity->userId,]); |
|
326 | + $entity->ratingCacheLog = $this->cacheRatingRepository->getRatingUserCache(['cache_id' => $entity->cacheId, 'user_id' => $entity->userId, ]); |
|
327 | 327 | |
328 | 328 | return $entity; |
329 | 329 | } |