Introduce type hinting in methods prototype (PHP >= 7.1)

This commit is contained in:
Molkobain
2020-08-26 21:21:56 +02:00
parent 77cd764b1c
commit 825c70c001
30 changed files with 246 additions and 191 deletions

View File

@@ -109,8 +109,10 @@ class Button extends UIBlock
* @param string $sOnClickJsCode
*/
public function __construct(
$sLabel, $sId = null, $sName = '', $sValue = '', $sType = self::DEFAULT_TYPE, string $sTooltip = '', $sIconClass = '',
$sActionType = self::DEFAULT_ACTION_TYPE, $sColor = self::DEFAULT_COLOR, $sJsCode = '', $sOnClickJsCode = ''
string $sLabel, string $sId = null, string $sName = '', string $sValue = '', string $sType = self::DEFAULT_TYPE,
string $sTooltip = '', string $sIconClass = '',
string $sActionType = self::DEFAULT_ACTION_TYPE, string $sColor = self::DEFAULT_COLOR, string $sJsCode = '',
string $sOnClickJsCode = ''
) {
$this->sLabel = $sLabel;
$this->sName = $sName;
@@ -122,21 +124,21 @@ class Button extends UIBlock
$this->sColor = $sColor;
$this->sJsCode = $sJsCode;
$this->sOnClickJsCode = $sOnClickJsCode;
parent::__construct($sId);
}
/**
* @return string
*/
public function GetLabel(): string
public function GetLabel()
{
return $this->sLabel;
}
/**
* @param string $sLabel
*
*
* @return $this
*/
public function SetLabel(string $sLabel)
@@ -290,12 +292,13 @@ class Button extends UIBlock
/**
* @param string $sOnClickJsCode
*
*
* @return $this
*/
public function SetOnClickJsCode($sOnClickJsCode)
public function SetOnClickJsCode(string $sOnClickJsCode)
{
$this->sOnClickJsCode = $sOnClickJsCode;
return $this;
}
@@ -309,12 +312,13 @@ class Button extends UIBlock
/**
* @param string $sJsCode
*
*
* @return $this
*/
public function SetJsCode($sJsCode)
public function SetJsCode(string $sJsCode)
{
$this->sJsCode = $sJsCode;
return $this;
}
}