@@ -62,6 +62,6 @@ |
||
| 62 | 62 | |
| 63 | 63 | $result = $this->container->get('zikula_permissions_module.api.permission')->hasPermission($component, $instance, constant($level)); |
| 64 | 64 | |
| 65 | - return (bool) $result; |
|
| 65 | + return (bool)$result; |
|
| 66 | 66 | } |
| 67 | 67 | } |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | if ($gid < 1 || $uid < 1) { |
| 133 | 133 | throw new \InvalidArgumentException($this->__('Invalid Group ID or User ID.')); |
| 134 | 134 | } |
| 135 | - if (!$this->hasPermission('ZikulaGroupsModule::', $gid.'::', ACCESS_EDIT)) { |
|
| 135 | + if (!$this->hasPermission('ZikulaGroupsModule::', $gid . '::', ACCESS_EDIT)) { |
|
| 136 | 136 | throw new AccessDeniedException(); |
| 137 | 137 | } |
| 138 | 138 | $group = $this->get('zikula_groups_module.group_repository')->find($gid); |
@@ -66,8 +66,8 @@ |
||
| 66 | 66 | switch ($oldVersion) { |
| 67 | 67 | case '2.3.2': |
| 68 | 68 | case '2.4.0': |
| 69 | - $this->setVar('mailwarning', (bool) $this->getVar('mailwarning')); |
|
| 70 | - $this->setVar('hideclosed', (bool) $this->getVar('hideclosed')); |
|
| 69 | + $this->setVar('mailwarning', (bool)$this->getVar('mailwarning')); |
|
| 70 | + $this->setVar('hideclosed', (bool)$this->getVar('hideclosed')); |
|
| 71 | 71 | $this->setVar('hidePrivate', false); |
| 72 | 72 | case '2.4.1': |
| 73 | 73 | // future upgrade routines |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | case 'lang': |
| 140 | 140 | $addcurrentlang2url = $systemVars['languageurl']; |
| 141 | 141 | if ($addcurrentlang2url == 0) { |
| 142 | - $pager['args'][$k] = $v; |
|
| 142 | + $pager['args'][$k] = $v; |
|
| 143 | 143 | } |
| 144 | 144 | break; |
| 145 | 145 | default: |
@@ -161,19 +161,19 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | } elseif (strlen($vv)) { |
| 163 | 163 | $tkey = $k . '[' . $kk . ']'; |
| 164 | - $pager['args'][$tkey] = $vv; |
|
| 164 | + $pager['args'][$tkey] = $vv; |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | } else { |
| 168 | 168 | if (strlen($v)) { |
| 169 | - $pager['args'][$k] = $v; |
|
| 169 | + $pager['args'][$k] = $v; |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - $pagerUrl = function ($pager) use ($routeName, $systemVars) { |
|
| 176 | + $pagerUrl = function($pager) use ($routeName, $systemVars) { |
|
| 177 | 177 | if ($routeName) { |
| 178 | 178 | return $this->container->get('router')->generate($routeName, $pager['args']); |
| 179 | 179 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | // predefined abc |
| 374 | 374 | if (strtolower($params['skin']) == 'hu') { |
| 375 | 375 | // Hungarian |
| 376 | - $pager['names'] = $pager['values'] = ['A', '?', 'B', 'C', 'D', 'E', '?', 'F', 'G', 'H', 'I', '?', 'J', 'K', 'L', 'M', 'N', 'O', '?', '?', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', '?', '?', 'U', 'V', 'W', 'X', 'Y', 'Z']; |
|
| 376 | + $pager['names'] = $pager['values'] = ['A', '?', 'B', 'C', 'D', 'E', '?', 'F', 'G', 'H', 'I', '?', 'J', 'K', 'L', 'M', 'N', 'O', '?', '?', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', '?', '?', 'U', 'V', 'W', 'X', 'Y', 'Z']; |
|
| 377 | 377 | //$params['names'] = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U' ,'V','W','X','Y','Z'); |
| 378 | 378 | //$params['values'] = array('A,?','B','C','D','E,?','F','G','H','I,?','J','K','L','M','N','O,?,?,O','P','Q','R','S','T','U,?,?,U','V','W','X','Y','Z'); |
| 379 | 379 | } else { |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | unset($params['names']); |
| 388 | 388 | unset($params['values']); |
| 389 | 389 | unset($params['route']); |
| 390 | - $pagerUrl = function ($pager) { |
|
| 390 | + $pagerUrl = function($pager) { |
|
| 391 | 391 | return $this->container->get('router')->generate($pager['route'], $pager['args']); |
| 392 | 392 | }; |
| 393 | 393 | $allVars = array_merge($request->request->all(), $request->query->all(), $request->attributes->get('_route_params', [])); |
@@ -418,38 +418,38 @@ discard block |
||
| 418 | 418 | } |
| 419 | 419 | unset($pager['args'][$pager['posvar']]); |
| 420 | 420 | // begin to fill the output |
| 421 | - $output = '<ul class="'.$params['class'].'">'."\n"; |
|
| 421 | + $output = '<ul class="' . $params['class'] . '">' . "\n"; |
|
| 422 | 422 | $style = ''; |
| 423 | 423 | if ($params['printempty']) { |
| 424 | 424 | $active = ''; |
| 425 | 425 | if (!empty($params['class_numon'])) { |
| 426 | 426 | if (!isset($allVars[$pager['posvar']])) { |
| 427 | - $style = ' class="'.$params['class_numon'].'"'; |
|
| 427 | + $style = ' class="' . $params['class_numon'] . '"'; |
|
| 428 | 428 | $active = 'class="active"'; |
| 429 | 429 | } elseif (!empty($params['class_num'])) { |
| 430 | - $style = ' class="'.$params['class_num'].'"'; |
|
| 430 | + $style = ' class="' . $params['class_num'] . '"'; |
|
| 431 | 431 | } else { |
| 432 | 432 | $style = ''; |
| 433 | 433 | } |
| 434 | 434 | } |
| 435 | 435 | $vars[$pager['posvar']] = ''; |
| 436 | - $output .= '<li '.$active.'><a '.$style.' href="'.$pagerUrl($pager).'"> -'."\n</a></li>"; |
|
| 436 | + $output .= '<li ' . $active . '><a ' . $style . ' href="' . $pagerUrl($pager) . '"> -' . "\n</a></li>"; |
|
| 437 | 437 | } |
| 438 | 438 | $style = ''; |
| 439 | 439 | foreach (array_keys($pager['names']) as $i) { |
| 440 | 440 | $active = ''; |
| 441 | 441 | if (!empty($params['class_numon'])) { |
| 442 | 442 | if (isset($allVars[$pager['posvar']]) && $allVars[$pager['posvar']] == $pager['values'][$i]) { |
| 443 | - $style = ' class="'.$params['class_numon'].'"'; |
|
| 443 | + $style = ' class="' . $params['class_numon'] . '"'; |
|
| 444 | 444 | $active = 'class="active"'; |
| 445 | 445 | } elseif (!empty($params['class_num'])) { |
| 446 | - $style = ' class="'.$params['class_num'].'"'; |
|
| 446 | + $style = ' class="' . $params['class_num'] . '"'; |
|
| 447 | 447 | } else { |
| 448 | 448 | $style = ''; |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | $pager['args'][$pager['posvar']] = $pager['values'][$i]; |
| 452 | - $output .= '<li '.$active.'><a '.$style.' href="'.$pagerUrl($pager).'">'.$pager['names'][$i]."</a></li>\n"; |
|
| 452 | + $output .= '<li ' . $active . '><a ' . $style . ' href="' . $pagerUrl($pager) . '">' . $pager['names'][$i] . "</a></li>\n"; |
|
| 453 | 453 | } |
| 454 | 454 | $output .= "</ul>\n"; |
| 455 | 455 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | /** |
| 48 | 48 | * Returns a list of functions to add to the existing list. |
| 49 | 49 | * |
| 50 | - * @return array An array of functions |
|
| 50 | + * @return \Twig_SimpleFunction[] An array of functions |
|
| 51 | 51 | */ |
| 52 | 52 | public function getFunctions() |
| 53 | 53 | { |
@@ -59,11 +59,11 @@ |
||
| 59 | 59 | $availableLanguages = []; |
| 60 | 60 | foreach ($matches as $match) { |
| 61 | 61 | list($languageCode, $unusedVar) = explode('-', $match[1]) + ['', '']; |
| 62 | - $priority = isset($match[2]) ? (float) $match[2] : 1.0; |
|
| 62 | + $priority = isset($match[2]) ? (float)$match[2] : 1.0; |
|
| 63 | 63 | $availableLanguages[][$languageCode] = $priority; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - $defaultPriority = (float) 0; |
|
| 66 | + $defaultPriority = (float)0; |
|
| 67 | 67 | $matchedLanguage = ''; |
| 68 | 68 | foreach ($availableLanguages as $key => $value) { |
| 69 | 69 | $languageCode = key($value); |
@@ -182,9 +182,9 @@ discard block |
||
| 182 | 182 | $ldir = dirname(__FILE__); |
| 183 | 183 | $p = strpos($ldir, DIRECTORY_SEPARATOR . 'system'); // we are in system/AdminModule |
| 184 | 184 | $b = substr($ldir, 0, $p); |
| 185 | - $filePath = $b.'/'.$appDir.'/.htaccess'; |
|
| 185 | + $filePath = $b . '/' . $appDir . '/.htaccess'; |
|
| 186 | 186 | } else { |
| 187 | - $filePath = $appDir.'/.htaccess'; |
|
| 187 | + $filePath = $appDir . '/.htaccess'; |
|
| 188 | 188 | } |
| 189 | 189 | $app_htaccess = file_exists($filePath); |
| 190 | 190 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | return $this->render('@ZikulaAdminModule/AdminInterface/securityAnalyzer.html.twig', [ |
| 200 | 200 | 'security' => [ |
| 201 | 201 | 'config_php' => is_writable('config/config.php'), |
| 202 | - 'magic_quotes_gpc' => (bool) get_magic_quotes_gpc(), // should be off anyway... |
|
| 202 | + 'magic_quotes_gpc' => (bool)get_magic_quotes_gpc(), // should be off anyway... |
|
| 203 | 203 | 'app_htaccess' => $app_htaccess, |
| 204 | 204 | 'updatecheck' => $variableApi->getSystemVar('updatecheck'), |
| 205 | 205 | 'scactive' => $hasSecurityCenter, |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | // truncate the user name to $maxLength chars |
| 144 | 144 | $length = strlen($userDisplayName); |
| 145 | 145 | $truncEnd = ($maxLength > $length) ? $length : $maxLength; |
| 146 | - $show = htmlspecialchars(substr($userDisplayName, 0, $truncEnd), ENT_QUOTES); |
|
| 146 | + $show = htmlspecialchars(substr($userDisplayName, 0, $truncEnd), ENT_QUOTES); |
|
| 147 | 147 | } else { |
| 148 | 148 | $show = htmlspecialchars($userDisplayName, ENT_QUOTES); |
| 149 | 149 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | $this->kernel = $kernel; |
| 34 | 34 | |
| 35 | 35 | $this->setName('Zikula'); |
| 36 | - $this->setVersion(ZikulaKernel::VERSION.' - '.$kernel->getName().'/'.$kernel->getEnvironment().($kernel->isDebug() ? '/debug' : '')); |
|
| 36 | + $this->setVersion(ZikulaKernel::VERSION . ' - ' . $kernel->getName() . '/' . $kernel->getEnvironment() . ($kernel->isDebug() ? '/debug' : '')); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | protected function registerCommands() |
@@ -225,8 +225,8 @@ discard block |
||
| 225 | 225 | { |
| 226 | 226 | $string = preg_replace_callback( |
| 227 | 227 | '/(.)@(.)/s', |
| 228 | - function ($m) { |
|
| 229 | - return "&#" . sprintf("%03d", ord($m[1])) . ";@&#" .sprintf("%03d", ord($m[2])) . ";"; |
|
| 228 | + function($m) { |
|
| 229 | + return "&#" . sprintf("%03d", ord($m[1])) . ";@&#" . sprintf("%03d", ord($m[2])) . ";"; |
|
| 230 | 230 | }, |
| 231 | 231 | $string |
| 232 | 232 | ); |
@@ -273,9 +273,9 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | // ensure proper variable types |
| 276 | - $value = (string) $value; |
|
| 277 | - $type = (string) $type; |
|
| 278 | - $weight = (int) $weight; |
|
| 276 | + $value = (string)$value; |
|
| 277 | + $type = (string)$type; |
|
| 278 | + $weight = (int)$weight; |
|
| 279 | 279 | |
| 280 | 280 | if ('stylesheet' == $type) { |
| 281 | 281 | $this->container->get('zikula_core.common.theme.assets_css')->add([$value => $weight]); |