Skip to content
Snippets Groups Projects
Commit 754b2455 authored by Benjamin Mack's avatar Benjamin Mack Committed by Susanne Moog
Browse files

[BUGFIX] IfViewHelpers use method signature from parent

In order to become PHP7 compliant, the IfViewHelpers should
register their arguments via the registerArgument() method
instead of extending the render() method with additional
parameters. This is not allowed in PHP7 and is therefore
changed in order to be compatible with PHP7.

Releases: master
Resolves: #68634
Change-Id: Ia3fa86541d5e112813da3c1d32edfe6180f6f621
Reviewed-on: http://review.typo3.org/42115


Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarSusanne Moog <typo3@susannemoog.de>
Tested-by: default avatarSusanne Moog <typo3@susannemoog.de>
parent a4b58f2e
Branches
Tags
No related merge requests found
......@@ -63,15 +63,14 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Be\Security;
class IfHasRoleViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper {
/**
* renders <f:then> child if the current logged in BE user belongs to the specified role (aka usergroup)
* Initializes the "role" argument.
* Renders <f:then> child if the current logged in BE user belongs to the specified role (aka usergroup)
* otherwise renders <f:else> child.
*
* @param string $role The usergroup (either the usergroup uid or its title)
* @return string the rendered string
* @api
* @return void
*/
public function render($role) {
return parent::render();
public function initializeArguments() {
$this->registerArgument('role', 'string', 'The usergroup (either the usergroup uid or its title).');
}
/**
......
......@@ -84,13 +84,10 @@ namespace TYPO3\CMS\Fluid\ViewHelpers;
class IfViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper {
/**
* renders <f:then> child if $condition is true, otherwise renders <f:else> child.
*
* @param bool $condition View helper condition
* @return string the rendered string
* @api
* @return void
*/
public function render($condition) {
return parent::render();
public function initializeArguments() {
$this->registerArgument('condition', 'boolean', 'Condition to be evaluated.');
}
}
......@@ -63,15 +63,14 @@ namespace TYPO3\CMS\Fluid\ViewHelpers\Security;
class IfHasRoleViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper {
/**
* renders <f:then> child if the current logged in FE user belongs to the specified role (aka usergroup)
* Initializes the "role" argument.
* Renders <f:then> child if the current logged in FE user belongs to the specified role (aka usergroup)
* otherwise renders <f:else> child.
*
* @param string $role The usergroup (either the usergroup uid or its title)
* @return string the rendered string
* @api
* @return void
*/
public function render($role) {
return parent::render();
public function initializeArguments() {
$this->registerArgument('role', 'string', 'The usergroup (either the usergroup uid or its title).');
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment