@@ -33,10 +33,10 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function __invoke($options = array()) |
| 35 | 35 | { |
| 36 | - if ( is_object($options) && method_exists($options, 'toArray') ) { |
|
| 36 | + if (is_object($options) && method_exists($options, 'toArray')) { |
|
| 37 | 37 | $options = $options->toArray(); |
| 38 | - } else if ( is_object($options) ) { |
|
| 39 | - $options = (array)$options; |
|
| 38 | + } else if (is_object($options)) { |
|
| 39 | + $options = (array) $options; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | if (isset($options['container']) && (null !== $options['container'])) { |
@@ -125,30 +125,30 @@ |
||
| 125 | 125 | */ |
| 126 | 126 | public function exchangeArray($data = array(), $forceEncryptPassword = false) |
| 127 | 127 | { |
| 128 | - if (isset($data['id']) && !empty($data["id"]) ) { |
|
| 128 | + if (isset($data['id']) && !empty($data["id"])) { |
|
| 129 | 129 | $this->id = ($data['id']); |
| 130 | 130 | $this->user_id = ($data['id']); |
| 131 | - } elseif (isset($data['user_id']) && !empty($data["user_id"]) ) { |
|
| 131 | + } elseif (isset($data['user_id']) && !empty($data["user_id"])) { |
|
| 132 | 132 | $this->id = ($data['user_id']); |
| 133 | 133 | $this->user_id = ($data['user_id']); |
| 134 | 134 | } |
| 135 | - $this->username = (isset($data['username'])) ? $data['username'] : $this->username; |
|
| 136 | - $this->email = (isset($data['email'])) ? $data['email'] : $this->email; |
|
| 137 | - if (isset($data['displayName']) ) { |
|
| 135 | + $this->username = (isset($data['username'])) ? $data['username'] : $this->username; |
|
| 136 | + $this->email = (isset($data['email'])) ? $data['email'] : $this->email; |
|
| 137 | + if (isset($data['displayName'])) { |
|
| 138 | 138 | $this->display_name = $data['displayName']; |
| 139 | 139 | $this->displayName = $data['displayName']; |
| 140 | - } elseif (isset($data['display_name']) ) { |
|
| 140 | + } elseif (isset($data['display_name'])) { |
|
| 141 | 141 | $this->display_name = $data['display_name']; |
| 142 | 142 | $this->displayName = $data['display_name']; |
| 143 | 143 | } |
| 144 | - if (isset($data["password"]) && $forceEncryptPassword ) { |
|
| 144 | + if (isset($data["password"]) && $forceEncryptPassword) { |
|
| 145 | 145 | $bcrypt = new Bcrypt; |
| 146 | 146 | $bcrypt->setCost(null); // @TODO $this->getUserService()->getOptions()->getPasswordCost()); |
| 147 | 147 | $data["password"] = $bcrypt->create($data['password']); |
| 148 | 148 | } |
| 149 | - $this->password = (isset($data['password'])) ? $data['password'] : $this->password; |
|
| 149 | + $this->password = (isset($data['password'])) ? $data['password'] : $this->password; |
|
| 150 | 150 | $this->state = (isset($data['state'])) ? $data['state'] : $this->state; |
| 151 | - $this->aclrole = (isset($data['aclrole'])) ? $data['aclrole'] : $this->aclrole; |
|
| 151 | + $this->aclrole = (isset($data['aclrole'])) ? $data['aclrole'] : $this->aclrole; |
|
| 152 | 152 | $this->token = (isset($data['token'])) ? $data['token'] : $this->token; |
| 153 | 153 | |
| 154 | 154 | return $this; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $controller = $params['controller']; |
| 73 | 73 | if (isset($params['__NAMESPACE__'])) { |
| 74 | - $controller = $params['__NAMESPACE__'] . '\\' . $params['controller']; |
|
| 74 | + $controller = $params['__NAMESPACE__'].'\\'.$params['controller']; |
|
| 75 | 75 | } |
| 76 | 76 | $action = $params['action']; |
| 77 | 77 | |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | $info = $this->requestInfo(); |
| 104 | 104 | if ($info) { |
| 105 | - $slug = strtolower($info['module']) . '-' . |
|
| 106 | - strtolower($info['controller']) . '-' . |
|
| 105 | + $slug = strtolower($info['module']).'-'. |
|
| 106 | + strtolower($info['controller']).'-'. |
|
| 107 | 107 | strtolower($info['action']); |
| 108 | 108 | |
| 109 | 109 | return $slug; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $escaper = $this->view->plugin('escapeHtmlAttr'); |
| 213 | 213 | |
| 214 | 214 | if ($found) { |
| 215 | - $foundPage = $found['page']; |
|
| 215 | + $foundPage = $found['page']; |
|
| 216 | 216 | $foundDepth = $found['depth']; |
| 217 | 217 | } else { |
| 218 | 218 | $foundPage = null; |
@@ -261,34 +261,33 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | // make sure indentation is correct |
| 263 | 263 | $depth -= $minDepth; |
| 264 | - $myIndent = $indent . str_repeat(' ', $depth); |
|
| 264 | + $myIndent = $indent.str_repeat(' ', $depth); |
|
| 265 | 265 | $attributes = $this->getAttributes(); |
| 266 | 266 | if ($depth > $prevDepth) { |
| 267 | 267 | // start new ul tag |
| 268 | - $ulClass = '' . |
|
| 269 | - ($depth == 0 ? $this->getUlClass() : |
|
| 270 | - ($depth == 1 ? $this->getSubUlClassLevel1() : $this->getSubUlClass()) |
|
| 271 | - ) . |
|
| 272 | - ' level_' . $depth . |
|
| 268 | + $ulClass = ''. |
|
| 269 | + ($depth == 0 ? $this->getUlClass() : ($depth == 1 ? $this->getSubUlClassLevel1() : $this->getSubUlClass()) |
|
| 270 | + ). |
|
| 271 | + ' level_'.$depth. |
|
| 273 | 272 | ''; |
| 274 | - if ($ulClass && $depth == 0) { |
|
| 275 | - $ulClass = ' class="' . $escaper($ulClass) . '"'; |
|
| 273 | + if ($ulClass && $depth == 0) { |
|
| 274 | + $ulClass = ' class="'.$escaper($ulClass).'"'; |
|
| 276 | 275 | } else { |
| 277 | - $ulClass = ' class="' . $escaper($ulClass) . '"'; |
|
| 276 | + $ulClass = ' class="'.$escaper($ulClass).'"'; |
|
| 278 | 277 | } |
| 279 | - $html .= $myIndent . '<ul' . $ulClass . ' '.($depth == 0 ? $this->htmlAttribs($attributes) : '').'>' . PHP_EOL; |
|
| 278 | + $html .= $myIndent.'<ul'.$ulClass.' '.($depth == 0 ? $this->htmlAttribs($attributes) : '').'>'.PHP_EOL; |
|
| 280 | 279 | } elseif ($prevDepth > $depth) { |
| 281 | 280 | // close li/ul tags until we're at current depth |
| 282 | 281 | for ($i = $prevDepth; $i > $depth; $i--) { |
| 283 | - $ind = $indent . str_repeat(' ', $i); |
|
| 284 | - $html .= $ind . ' </li>' . PHP_EOL; |
|
| 285 | - $html .= $ind . '</ul>' . PHP_EOL; |
|
| 282 | + $ind = $indent.str_repeat(' ', $i); |
|
| 283 | + $html .= $ind.' </li>'.PHP_EOL; |
|
| 284 | + $html .= $ind.'</ul>'.PHP_EOL; |
|
| 286 | 285 | } |
| 287 | 286 | // close previous li tag |
| 288 | - $html .= $myIndent . ' </li>' . PHP_EOL; |
|
| 287 | + $html .= $myIndent.' </li>'.PHP_EOL; |
|
| 289 | 288 | } else { |
| 290 | 289 | // close previous li tag |
| 291 | - $html .= $myIndent . ' </li>' . PHP_EOL; |
|
| 290 | + $html .= $myIndent.' </li>'.PHP_EOL; |
|
| 292 | 291 | } |
| 293 | 292 | |
| 294 | 293 | // render li tag and page |
@@ -308,10 +307,10 @@ discard block |
||
| 308 | 307 | if ($addClassToListItem && $page->getClass()) { |
| 309 | 308 | $liClasses[] = $page->getClass(); |
| 310 | 309 | } |
| 311 | - $liClass = empty($liClasses) ? '' : ' class="' . $escaper(implode(' ', $liClasses)) . '"'; |
|
| 310 | + $liClass = empty($liClasses) ? '' : ' class="'.$escaper(implode(' ', $liClasses)).'"'; |
|
| 312 | 311 | |
| 313 | - $html .= $myIndent . ' <li' . $liClass . '>' . PHP_EOL |
|
| 314 | - . $myIndent . ' ' . $this->htmlify($page, $escapeLabels, $addClassToListItem) . PHP_EOL; |
|
| 312 | + $html .= $myIndent.' <li'.$liClass.'>'.PHP_EOL |
|
| 313 | + . $myIndent.' '.$this->htmlify($page, $escapeLabels, $addClassToListItem).PHP_EOL; |
|
| 315 | 314 | |
| 316 | 315 | // store as previous depth for next iteration |
| 317 | 316 | $prevDepth = $depth; |
@@ -319,10 +318,10 @@ discard block |
||
| 319 | 318 | |
| 320 | 319 | if ($html) { |
| 321 | 320 | // done iterating container; close open ul/li tags |
| 322 | - for ($i = $prevDepth+1; $i > 0; $i--) { |
|
| 323 | - $myIndent = $indent . str_repeat(' ', $i-1); |
|
| 324 | - $html .= $myIndent . ' </li>' . PHP_EOL |
|
| 325 | - . $myIndent . '</ul>' . PHP_EOL; |
|
| 321 | + for ($i = $prevDepth + 1; $i > 0; $i--) { |
|
| 322 | + $myIndent = $indent.str_repeat(' ', $i - 1); |
|
| 323 | + $html .= $myIndent.' </li>'.PHP_EOL |
|
| 324 | + . $myIndent.'</ul>'.PHP_EOL; |
|
| 326 | 325 | } |
| 327 | 326 | $html = rtrim($html, PHP_EOL); |
| 328 | 327 | } |
@@ -353,7 +352,7 @@ discard block |
||
| 353 | 352 | */ |
| 354 | 353 | public function findActive($container = null, $minDepth = null, $maxDepth = -1) |
| 355 | 354 | { |
| 356 | - if ( null == $container ) { |
|
| 355 | + if (null == $container) { |
|
| 357 | 356 | $container = $this->getContainer(); |
| 358 | 357 | } |
| 359 | 358 | return parent::findActive($container, $minDepth, $maxDepth); |
@@ -370,7 +369,7 @@ discard block |
||
| 370 | 369 | * @param bool $addClassToListItem Whether or not to add the page class to the list item |
| 371 | 370 | * @return string |
| 372 | 371 | */ |
| 373 | - public function htmlify(AbstractPage $page, $escapeLabel = true, $addClassToListItem = false, $extraAttributes = [] ) |
|
| 372 | + public function htmlify(AbstractPage $page, $escapeLabel = true, $addClassToListItem = false, $extraAttributes = []) |
|
| 374 | 373 | { |
| 375 | 374 | $partial = $this->getHtmlifyPartial(); |
| 376 | 375 | if ($partial) { |
@@ -380,11 +379,11 @@ discard block |
||
| 380 | 379 | $attribs = array_merge([ |
| 381 | 380 | 'id' => $page->getId(), |
| 382 | 381 | 'title' => $this->translate($page->getTitle(), $page->getTextDomain()), |
| 383 | - 'data-test' => 'cta-nav-' . $this->slugify($page->getLabel()), |
|
| 382 | + 'data-test' => 'cta-nav-'.$this->slugify($page->getLabel()), |
|
| 384 | 383 | ], $extraAttributes); |
| 385 | 384 | |
| 386 | 385 | $classnames = array(); |
| 387 | - if ( $addClassToListItem === false ) { |
|
| 386 | + if ($addClassToListItem === false) { |
|
| 388 | 387 | $class = $page->getClass(); |
| 389 | 388 | if (!empty($class)) { |
| 390 | 389 | $classnames[] = $page->getClass(); |
@@ -393,7 +392,7 @@ discard block |
||
| 393 | 392 | $maxDepth = $this->getMaxDepth(); |
| 394 | 393 | $depth = $page->get('level'); |
| 395 | 394 | $isBelowMaxLevel = ($maxDepth > $depth) || ($maxDepth === null) || ($maxDepth === false); |
| 396 | - if ( !empty($page->pages) && $isBelowMaxLevel ) { |
|
| 395 | + if (!empty($page->pages) && $isBelowMaxLevel) { |
|
| 397 | 396 | $classnames[] = 'dropdown-toggle'; |
| 398 | 397 | $attribs['data-toggle'] = (($depth == 0) ? $this->getSubLiClassLevel0() : $this->getSubLiClass()); |
| 399 | 398 | } |
@@ -412,8 +411,8 @@ discard block |
||
| 412 | 411 | $attribs['href'] = '#'; |
| 413 | 412 | } |
| 414 | 413 | |
| 415 | - $html = '<' . $element . $this->htmlAttribs($attribs) . '>'; |
|
| 416 | - $html .= ($page->get('icon') ? '<span class="' . $this->getIconPrefixClass() . '' . $page->get('icon') . '"></span> ' : '' ); |
|
| 414 | + $html = '<'.$element.$this->htmlAttribs($attribs).'>'; |
|
| 415 | + $html .= ($page->get('icon') ? '<span class="'.$this->getIconPrefixClass().''.$page->get('icon').'"></span> ' : ''); |
|
| 417 | 416 | $label = $this->translate($page->getLabel(), $page->getTextDomain()); |
| 418 | 417 | if ($escapeLabel === true) { |
| 419 | 418 | /** @var \Zend\View\Helper\EscapeHtml $escaper */ |
@@ -422,7 +421,7 @@ discard block |
||
| 422 | 421 | } else { |
| 423 | 422 | $html .= $label; |
| 424 | 423 | } |
| 425 | - $html .= '</' . $element . '>'; |
|
| 424 | + $html .= '</'.$element.'>'; |
|
| 426 | 425 | |
| 427 | 426 | return $html; |
| 428 | 427 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | |
| 424 | 424 | } catch (\Exception $e) { |
| 425 | 425 | |
| 426 | - $msg = get_class($e) . ': ' . $e->getMessage() . "\n" . $e->getTraceAsString(); |
|
| 426 | + $msg = get_class($e).': '.$e->getMessage()."\n".$e->getTraceAsString(); |
|
| 427 | 427 | trigger_error($msg, E_USER_ERROR); |
| 428 | 428 | return ''; |
| 429 | 429 | |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | |
| 449 | 449 | $list = ''; |
| 450 | 450 | $current = Locale::getDefault(); |
| 451 | - foreach($detector->getSupported() as $locale) { |
|
| 451 | + foreach ($detector->getSupported() as $locale) { |
|
| 452 | 452 | if ($this->omitCurrent() && $current === $locale) { |
| 453 | 453 | continue; |
| 454 | 454 | } |
@@ -463,18 +463,18 @@ discard block |
||
| 463 | 463 | $displayName = $this->getLocaleProperty('displayName', $locale, $labelLocale); |
| 464 | 464 | |
| 465 | 465 | $item = sprintf( |
| 466 | - '<li><a href="%s" title="%s"%s %s>%s</a></li>' . "\n", |
|
| 466 | + '<li><a href="%s" title="%s"%s %s>%s</a></li>'."\n", |
|
| 467 | 467 | $url, |
| 468 | 468 | $displayName, |
| 469 | 469 | ($current === $locale) ? ' class="active"' : '', |
| 470 | 470 | 'data-test="cta-lang-'.$this->slugify($label).'"', |
| 471 | - (($iconprefixclass) ? '<span class="' . $iconprefixclass . $primary . '"></span> ' : '') . $label |
|
| 471 | + (($iconprefixclass) ? '<span class="'.$iconprefixclass.$primary.'"></span> ' : '').$label |
|
| 472 | 472 | ); |
| 473 | 473 | |
| 474 | 474 | $list .= $item; |
| 475 | 475 | } |
| 476 | 476 | $attributes = $this->getAttributes(); |
| 477 | - $html = |
|
| 477 | + $html = |
|
| 478 | 478 | '<ul'.(($class) ? sprintf(' class="%s"', $class) : '').' '.($this->htmlAttribs($attributes)).'>'. |
| 479 | 479 | '<li'.(($liclass) ? sprintf(' class="%s"', $liclass) : '').'>'. |
| 480 | 480 | '<a href="" '. |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | 'data-test="cta-lang-selector cta-lang-selected-'.$this->slugify(Locale::getDisplayLanguage(null)).'"'. |
| 487 | 487 | '>'. |
| 488 | 488 | '<span class="'.(($iconprefixclass) ? $iconprefixclass : '').Locale::getPrimaryLanguage(null).'"></span> '. |
| 489 | - ''.Locale::getDisplayLanguage(null). // ' - '.Locale::getDefault().' - '.Locale::getPrimaryLanguage(null).''. |
|
| 489 | + ''.Locale::getDisplayLanguage(null).// ' - '.Locale::getDefault().' - '.Locale::getPrimaryLanguage(null).''. |
|
| 490 | 490 | '<span class="caret"></span>'. |
| 491 | 491 | '</a>'. |
| 492 | 492 | sprintf( |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $escaper = $this->view->plugin('escapeHtmlAttr'); |
| 98 | 98 | |
| 99 | 99 | if ($found) { |
| 100 | - $foundPage = $found['page']; |
|
| 100 | + $foundPage = $found['page']; |
|
| 101 | 101 | $foundDepth = $found['depth']; |
| 102 | 102 | } else { |
| 103 | 103 | $foundPage = null; |
@@ -146,28 +146,27 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | // make sure indentation is correct |
| 148 | 148 | $depth -= $minDepth; |
| 149 | - $myIndent = $indent . str_repeat(' ', $depth); |
|
| 149 | + $myIndent = $indent.str_repeat(' ', $depth); |
|
| 150 | 150 | |
| 151 | 151 | if ($depth > $prevDepth) { |
| 152 | 152 | // start new ul tag |
| 153 | - $ulClass = '' . |
|
| 154 | - ($depth == 0 ? $this->getUlClass() : |
|
| 155 | - ($depth == 1 ? $this->getSubUlClassLevel1() : $this->getSubUlClass()) |
|
| 156 | - ) . |
|
| 157 | - ' level_' . $depth . |
|
| 153 | + $ulClass = ''. |
|
| 154 | + ($depth == 0 ? $this->getUlClass() : ($depth == 1 ? $this->getSubUlClassLevel1() : $this->getSubUlClass()) |
|
| 155 | + ). |
|
| 156 | + ' level_'.$depth. |
|
| 158 | 157 | ''; |
| 159 | - if ($ulClass && $depth == 0) { |
|
| 160 | - $ulClass = ' class="' . $escaper($ulClass) . '"'; |
|
| 158 | + if ($ulClass && $depth == 0) { |
|
| 159 | + $ulClass = ' class="'.$escaper($ulClass).'"'; |
|
| 161 | 160 | } else { |
| 162 | - $ulClass = ' class="' . $escaper($ulClass) . '"'; |
|
| 161 | + $ulClass = ' class="'.$escaper($ulClass).'"'; |
|
| 163 | 162 | } |
| 164 | - $html .= $myIndent . '<' . $this->getTagname() . $ulClass . '>' . PHP_EOL; |
|
| 163 | + $html .= $myIndent.'<'.$this->getTagname().$ulClass.'>'.PHP_EOL; |
|
| 165 | 164 | } elseif ($prevDepth > $depth) { |
| 166 | 165 | // close li/ul tags until we're at current depth |
| 167 | 166 | for ($i = $prevDepth; $i > $depth; $i--) { |
| 168 | - $ind = $indent . str_repeat(' ', $i); |
|
| 167 | + $ind = $indent.str_repeat(' ', $i); |
|
| 169 | 168 | //$html .= $ind . ' </li>' . PHP_EOL; |
| 170 | - $html .= $ind . '</' . $this->getTagname() . '>' . PHP_EOL; |
|
| 169 | + $html .= $ind.'</'.$this->getTagname().'>'.PHP_EOL; |
|
| 171 | 170 | } |
| 172 | 171 | // close previous li tag |
| 173 | 172 | //$html .= $myIndent . ' </li>' . PHP_EOL; |
@@ -193,12 +192,12 @@ discard block |
||
| 193 | 192 | if ($addClassToListItem && $page->getClass()) { |
| 194 | 193 | $liClasses[] = $page->getClass(); |
| 195 | 194 | } |
| 196 | - $liClass = empty($liClasses) ? '' : ' class="' . $escaper(implode(' ', $liClasses)) . '"'; |
|
| 195 | + $liClass = empty($liClasses) ? '' : ' class="'.$escaper(implode(' ', $liClasses)).'"'; |
|
| 197 | 196 | |
| 198 | 197 | $html .= /* $myIndent . ' <li' . $liClass . '>' . PHP_EOL |
| 199 | - . */ $myIndent . ' ' . $this->htmlify($page, $escapeLabels, $addClassToListItem, [ |
|
| 200 | - 'data-test' => 'cta-toolbar-' . $this->slugify($page->getLabel()), |
|
| 201 | - ]) . PHP_EOL; |
|
| 198 | + . */ $myIndent.' '.$this->htmlify($page, $escapeLabels, $addClassToListItem, [ |
|
| 199 | + 'data-test' => 'cta-toolbar-'.$this->slugify($page->getLabel()), |
|
| 200 | + ]).PHP_EOL; |
|
| 202 | 201 | |
| 203 | 202 | // store as previous depth for next iteration |
| 204 | 203 | $prevDepth = $depth; |
@@ -206,10 +205,10 @@ discard block |
||
| 206 | 205 | |
| 207 | 206 | if ($html) { |
| 208 | 207 | // done iterating container; close open ul/li tags |
| 209 | - for ($i = $prevDepth+1; $i > 0; $i--) { |
|
| 210 | - $myIndent = $indent . str_repeat(' ', $i-1); |
|
| 208 | + for ($i = $prevDepth + 1; $i > 0; $i--) { |
|
| 209 | + $myIndent = $indent.str_repeat(' ', $i - 1); |
|
| 211 | 210 | $html .= /*$myIndent . ' </li>' . PHP_EOL |
| 212 | - . */ $myIndent . '</' . $this->getTagname() . '>' . PHP_EOL; |
|
| 211 | + . */ $myIndent.'</'.$this->getTagname().'>'.PHP_EOL; |
|
| 213 | 212 | } |
| 214 | 213 | $html = rtrim($html, PHP_EOL); |
| 215 | 214 | } |
@@ -232,7 +231,7 @@ discard block |
||
| 232 | 231 | * @param string $tagname |
| 233 | 232 | */ |
| 234 | 233 | public function setTagname($tagname) { |
| 235 | - if ( null !== $tagname ) { |
|
| 234 | + if (null !== $tagname) { |
|
| 236 | 235 | $this->tagname = $tagname; |
| 237 | 236 | } |
| 238 | 237 | return $this; |
@@ -112,24 +112,24 @@ discard block |
||
| 112 | 112 | /** @var \Zend\View\Helper\EscapeHtml $escaper */ |
| 113 | 113 | $escaper = $this->view->plugin('escapeHtml'); |
| 114 | 114 | |
| 115 | - $listHtmlOpen = '<ol class="'.$this->getOlClass().'" data-test="layout-breadcrumbs">' . PHP_EOL; |
|
| 116 | - if ( !empty($this->getHeader()) ) { |
|
| 117 | - $listHtmlOpen .= '<li class="' . $escaper($this->getHeaderClass()) . '" data-test="layout-breadcrumbs-header">' . $escaper($this->getHeader()) . '</li>' . PHP_EOL; |
|
| 115 | + $listHtmlOpen = '<ol class="'.$this->getOlClass().'" data-test="layout-breadcrumbs">'.PHP_EOL; |
|
| 116 | + if (!empty($this->getHeader())) { |
|
| 117 | + $listHtmlOpen .= '<li class="'.$escaper($this->getHeaderClass()).'" data-test="layout-breadcrumbs-header">'.$escaper($this->getHeader()).'</li>'.PHP_EOL; |
|
| 118 | 118 | } |
| 119 | 119 | // put the deepest active page last in breadcrumbs |
| 120 | 120 | if ($this->getLinkLast()) { |
| 121 | - $html = '<li class="active" data-test="layout-breadcrumbs-current">' . $this->htmlify($active) . '</li>' . PHP_EOL; |
|
| 121 | + $html = '<li class="active" data-test="layout-breadcrumbs-current">'.$this->htmlify($active).'</li>'.PHP_EOL; |
|
| 122 | 122 | } else { |
| 123 | - $html = '<li class="active" data-test="layout-breadcrumbs-current">' . $escaper( |
|
| 123 | + $html = '<li class="active" data-test="layout-breadcrumbs-current">'.$escaper( |
|
| 124 | 124 | $this->translate($active->getLabel()) //, $active->getTextDomain()) |
| 125 | - ) . '</li>' . PHP_EOL; |
|
| 125 | + ).'</li>'.PHP_EOL; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | // walk back to root |
| 129 | 129 | while ($parent = $active->getParent()) { |
| 130 | 130 | if ($parent instanceof AbstractPage) { |
| 131 | 131 | // prepend crumb to html |
| 132 | - $html = '<li data-test="layout-breadcrumbs-parent'.$parent->getLabel().'">' . $this->htmlify($parent) . '</li>' . PHP_EOL |
|
| 132 | + $html = '<li data-test="layout-breadcrumbs-parent'.$parent->getLabel().'">'.$this->htmlify($parent).'</li>'.PHP_EOL |
|
| 133 | 133 | //. $this->getSeparator() |
| 134 | 134 | . $html; |
| 135 | 135 | } |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | $active = $parent; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $listHtmlClose = '</ol>' . PHP_EOL; |
|
| 145 | + $listHtmlClose = '</ol>'.PHP_EOL; |
|
| 146 | 146 | |
| 147 | - return strlen($html) ? $listHtmlOpen . $this->getIndent() . $html . $listHtmlClose : ''; |
|
| 147 | + return strlen($html) ? $listHtmlOpen.$this->getIndent().$html.$listHtmlClose : ''; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | 'class' => $page->getClass(), |
| 166 | 166 | 'href' => $page->getHref(), |
| 167 | 167 | 'target' => $page->getTarget(), |
| 168 | - 'data-test' => 'cta-breadcrumbs-' . $this->slugify($page->getLabel()) |
|
| 168 | + 'data-test' => 'cta-breadcrumbs-'.$this->slugify($page->getLabel()) |
|
| 169 | 169 | ]; |
| 170 | 170 | |
| 171 | 171 | /** @var \Zend\View\Helper\EscapeHtml $escaper */ |
| 172 | 172 | $escaper = $this->view->plugin('escapeHtml'); |
| 173 | 173 | $label = $escaper($label); |
| 174 | 174 | |
| 175 | - return '<a' . $this->htmlAttribs($attribs) . '>' . $label . '</a>'; |
|
| 175 | + return '<a'.$this->htmlAttribs($attribs).'>'.$label.'</a>'; |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @return the $attribute |
| 37 | 37 | */ |
| 38 | 38 | public function getAttribute($name) { |
| 39 | - return ( isset($this->attributes[$name]) ? $this->attributes[$name] : null ); |
|
| 39 | + return (isset($this->attributes[$name]) ? $this->attributes[$name] : null); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @param mixed $value |
| 47 | 47 | */ |
| 48 | 48 | public function setAttribute($attribute, $value = "") { |
| 49 | - if ( null !== $attribute ) { |
|
| 49 | + if (null !== $attribute) { |
|
| 50 | 50 | $this->attributes[$attribute] = $value; |
| 51 | 51 | } |
| 52 | 52 | return $this; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * @param array $attributes |
| 68 | 68 | */ |
| 69 | 69 | public function setAttributes($attributes) { |
| 70 | - if ( is_array($attributes) ) { |
|
| 70 | + if (is_array($attributes)) { |
|
| 71 | 71 | $this->attributes = array_merge_recursive($this->attributes, $attributes); |
| 72 | 72 | } |
| 73 | 73 | return $this; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | // except for "data-" and "aria-" attributes |
| 89 | 89 | foreach ($attribs as $key => $value) { |
| 90 | 90 | if ($value === null || (is_string($value) && !strlen($value))) { |
| 91 | - if ( (strpos($key, "data") === false) && (strpos($key, "aria") === false) ) { |
|
| 91 | + if ((strpos($key, "data") === false) && (strpos($key, "aria") === false)) { |
|
| 92 | 92 | unset($attribs[$key]); |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $xhtml = ''; |
| 98 | 98 | $oView = $this->getView(); |
| 99 | - $escaper = function ($val) { return $val; }; |
|
| 100 | - $escapeHtmlAttr = function ($val) { return $val; }; |
|
| 101 | - if ( ($oView instanceof \Zend\View\Renderer\RendererInterface) ) { |
|
| 99 | + $escaper = function($val) { return $val; }; |
|
| 100 | + $escapeHtmlAttr = function($val) { return $val; }; |
|
| 101 | + if (($oView instanceof \Zend\View\Renderer\RendererInterface)) { |
|
| 102 | 102 | $escaper = $oView->plugin('escapehtml'); |
| 103 | 103 | $escapeHtmlAttr = $oView->plugin('escapehtmlattr'); |
| 104 | 104 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | return $xhtml; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - public function slugify ($text) { |
|
| 136 | + public function slugify($text) { |
|
| 137 | 137 | $rules = <<<'RULES' |
| 138 | 138 | :: Any-Latin; |
| 139 | 139 | :: NFD; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | RULES; |
| 148 | 148 | |
| 149 | 149 | return \Transliterator::createFromRules($rules) |
| 150 | - ->transliterate( $text ); |
|
| 150 | + ->transliterate($text); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | } |