N°3526 - Clean up pass on UIBlocks

- Move UIBlock::ENUM_BLOCK_FILES_TYPE_XXX to iUIBlock
- Add PHPDoc
- Remove Object return type hint on overloadable methods
- Add scalar return type hint
- Add type hint on parameters
This commit is contained in:
Molkobain
2021-11-14 21:22:04 +01:00
parent a9b30e160f
commit 3598da8808
45 changed files with 353 additions and 257 deletions

View File

@@ -39,7 +39,7 @@ class FileSelect extends UIBlock
/**
* @return string
*/
public function GetFileName()
public function GetFileName(): string
{
return $this->sFileName;
}

View File

@@ -61,7 +61,7 @@ class Input extends AbstractInput
/**
* @return bool
*/
public function IsChecked()
public function IsChecked(): bool
{
return $this->bIsChecked;
}
@@ -69,7 +69,7 @@ class Input extends AbstractInput
/**
* @return bool
*/
public function IsDisabled()
public function IsDisabled(): bool
{
return $this->bIsDisabled;
}
@@ -88,7 +88,7 @@ class Input extends AbstractInput
/**
* @return bool
*/
public function IsReadonly()
public function IsReadonly(): bool
{
return $this->bIsReadonly;
}
@@ -107,7 +107,7 @@ class Input extends AbstractInput
/**
* @return string|null
*/
public function GetLabel()
public function GetLabel(): ?string
{
return $this->sLabel;
}
@@ -124,7 +124,7 @@ class Input extends AbstractInput
return $this;
}
public function HasLabel()
public function HasLabel(): bool
{
return !is_null($this->sLabel);
}

View File

@@ -97,7 +97,7 @@ class InputWithLabel extends UIBlock
*
* @return InputWithLabel
*/
public function SetLabel(string $sLabel): InputWithLabel
public function SetLabel(string $sLabel)
{
$this->sLabel = $sLabel;
return $this;

View File

@@ -89,8 +89,10 @@ class Select extends UIContentBlock
/**
* @param bool $bIsMultiple {@see Select::$bIsMultiple}
*/
public function SetIsMultiple(bool $bIsMultiple): void
public function SetIsMultiple(bool $bIsMultiple)
{
$this->bIsMultiple = $bIsMultiple;
return $this;
}
}

View File

@@ -38,7 +38,7 @@ class SelectOption extends UIBlock
*
* @return SelectOption
*/
public function SetValue(string $sValue): SelectOption
public function SetValue(string $sValue)
{
$this->sValue = $sValue;
return $this;
@@ -57,7 +57,7 @@ class SelectOption extends UIBlock
*
* @return SelectOption
*/
public function SetLabel(string $sLabel): SelectOption
public function SetLabel(string $sLabel)
{
$this->sLabel = $sLabel;
return $this;
@@ -76,7 +76,7 @@ class SelectOption extends UIBlock
*
* @return SelectOption
*/
public function SetSelected(bool $bSelected): SelectOption
public function SetSelected(bool $bSelected)
{
$this->bSelected = $bSelected;
return $this;

View File

@@ -78,10 +78,14 @@ class TextArea extends AbstractInput
/**
* @param bool $bIsDisabled
*
* @return $this
*/
public function SetIsDisabled(bool $bIsDisabled): void
public function SetIsDisabled(bool $bIsDisabled)
{
$this->bIsDisabled = $bIsDisabled;
return $this;
}