@@ -47,6 +47,9 @@ discard block |
||
| 47 | 47 | $this->setTranslator($translator); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | + /** |
|
| 51 | + * @param TranslatorInterface $translator |
|
| 52 | + */ |
|
| 50 | 53 | public function setTranslator($translator) |
| 51 | 54 | { |
| 52 | 55 | $this->translator = $translator; |
@@ -210,6 +213,9 @@ discard block |
||
| 210 | 213 | return $this->getAreasByOwner($owner, self::PROVIDER); |
| 211 | 214 | } |
| 212 | 215 | |
| 216 | + /** |
|
| 217 | + * @param string $type |
|
| 218 | + */ |
|
| 213 | 219 | private function getAreasByOwner($owner, $type) |
| 214 | 220 | { |
| 215 | 221 | $dql = "SELECT t.areaname |
@@ -519,6 +525,9 @@ discard block |
||
| 519 | 525 | ->getArrayResult(); |
| 520 | 526 | } |
| 521 | 527 | |
| 528 | + /** |
|
| 529 | + * @param string $areaType |
|
| 530 | + */ |
|
| 522 | 531 | private function registerArea($areaName, $areaType, $owner, $subOwner, $category) |
| 523 | 532 | { |
| 524 | 533 | if ($areaType !== self::PROVIDER && $areaType !== self::SUBSCRIBER) { |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | /** |
| 113 | 113 | * Returns choices for category selection. |
| 114 | 114 | * |
| 115 | - * @param string $locale |
|
| 115 | + * @param Options $options |
|
| 116 | 116 | * @return array |
| 117 | 117 | */ |
| 118 | 118 | private function getCategoryChoices($options) |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $resolver->setAllowedTypes('all', 'bool'); |
| 71 | 71 | $resolver->setAllowedTypes('valueField', 'string'); |
| 72 | 72 | |
| 73 | - $resolver->setNormalizer('label', function (Options $options, $label) { |
|
| 73 | + $resolver->setNormalizer('label', function(Options $options, $label) { |
|
| 74 | 74 | if (null === $label || empty($label)) { |
| 75 | 75 | $isMultiple = $options['multiple']; |
| 76 | 76 | $translator = $options['translator']; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | return $label; |
| 82 | 82 | }); |
| 83 | - $resolver->setNormalizer('placeholder', function (Options $options, $placeholder) { |
|
| 83 | + $resolver->setNormalizer('placeholder', function(Options $options, $placeholder) { |
|
| 84 | 84 | if (!$options['required']) { |
| 85 | 85 | if (null == $placeholder || empty($placeholder)) { |
| 86 | 86 | $isMultiple = $options['multiple']; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | return $placeholder; |
| 94 | 94 | }); |
| 95 | - $resolver->setNormalizer('choices', function (Options $options, $choices) { |
|
| 95 | + $resolver->setNormalizer('choices', function(Options $options, $choices) { |
|
| 96 | 96 | if (empty($choices)) { |
| 97 | 97 | $choices = $this->getCategoryChoices($options); |
| 98 | 98 | } |
@@ -236,8 +236,8 @@ discard block |
||
| 236 | 236 | { |
| 237 | 237 | $string = preg_replace_callback( |
| 238 | 238 | '/(.)@(.)/s', |
| 239 | - function ($m) { |
|
| 240 | - return "&#" . sprintf("%03d", ord($m[1])) . ";@&#" .sprintf("%03d", ord($m[2])) . ";"; |
|
| 239 | + function($m) { |
|
| 240 | + return "&#" . sprintf("%03d", ord($m[1])) . ";@&#" . sprintf("%03d", ord($m[2])) . ";"; |
|
| 241 | 241 | }, |
| 242 | 242 | $string |
| 243 | 243 | ); |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | // truncate the user name to $maxLength chars |
| 339 | 339 | $length = strlen($userDisplayName); |
| 340 | 340 | $truncEnd = ($maxLength > $length) ? $length : $maxLength; |
| 341 | - $show = htmlspecialchars(substr($userDisplayName, 0, $truncEnd), ENT_QUOTES); |
|
| 341 | + $show = htmlspecialchars(substr($userDisplayName, 0, $truncEnd), ENT_QUOTES); |
|
| 342 | 342 | } else { |
| 343 | 343 | $show = htmlspecialchars($userDisplayName, ENT_QUOTES); |
| 344 | 344 | } |
@@ -387,9 +387,9 @@ discard block |
||
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | // ensure proper variable types |
| 390 | - $value = (string) $value; |
|
| 391 | - $type = (string) $type; |
|
| 392 | - $weight = (int) $weight; |
|
| 390 | + $value = (string)$value; |
|
| 391 | + $type = (string)$type; |
|
| 392 | + $weight = (int)$weight; |
|
| 393 | 393 | |
| 394 | 394 | if ('stylesheet' == $type) { |
| 395 | 395 | $this->container->get('zikula_core.common.theme.assets_css')->add([$value => $weight]); |
@@ -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 | |