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

@@ -90,7 +90,7 @@ class Alert extends UIBlock
* @param string $sColor
* @param string|null $sId
*/
public function __construct($sTitle = '', $sContent = '', $sColor = self::DEFAULT_COLOR, $sId = null)
public function __construct(string $sTitle = '', string $sContent = '', string $sColor = self::DEFAULT_COLOR, ?string $sId = null)
{
$this->sTitle = $sTitle;
$this->sContent = $sContent;
@@ -108,9 +108,10 @@ class Alert extends UIBlock
/**
* @param string $sTitle
*
* @return $this
*/
public function SetTitle($sTitle)
public function SetTitle(string $sTitle)
{
$this->sTitle = $sTitle;
@@ -134,7 +135,7 @@ class Alert extends UIBlock
*
* @return $this
*/
public function SetContent($sContent)
public function SetContent(string $sContent)
{
$this->sContent = $sContent;
@@ -153,9 +154,10 @@ class Alert extends UIBlock
* @param string $sColor
* @return $this
*/
public function SetColor($sColor)
public function SetColor(string $sColor)
{
$this->sColor = $sColor;
return $this;
}
}