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

@@ -115,7 +115,7 @@ class ActivityEntry extends UIBlock
*
* @return string
*/
public function GetType()
public function GetType(): string
{
return $this->sType;
}
@@ -139,7 +139,7 @@ class ActivityEntry extends UIBlock
*
* @return string
*/
public function GetDecorationClasses()
public function GetDecorationClasses(): string
{
return $this->sDecorationClasses;
}
@@ -163,7 +163,7 @@ class ActivityEntry extends UIBlock
*
* @return string
*/
public function GetContent()
public function GetContent(): string
{
return $this->sContent;
}
@@ -183,7 +183,7 @@ class ActivityEntry extends UIBlock
* Return the date time without formatting, as per the mysql format
* @return string
*/
public function GetRawDateTime()
public function GetRawDateTime(): string
{
return $this->oDateTime->format(AttributeDateTime::GetInternalFormat());
}
@@ -194,7 +194,7 @@ class ActivityEntry extends UIBlock
* @return string
* @throws \Exception
*/
public function GetFormattedDateTime()
public function GetFormattedDateTime(): string
{
$oDateTimeFormat = AttributeDateTime::GetFormat();
return $oDateTimeFormat->Format($this->oDateTime);
@@ -277,7 +277,7 @@ class ActivityEntry extends UIBlock
*
* @return bool
*/
public function IsFromCurrentUser()
public function IsFromCurrentUser(): bool
{
return $this->bIsFromCurrentUser;
}
@@ -301,7 +301,7 @@ class ActivityEntry extends UIBlock
*
* @return string
*/
public function GetOrigin()
public function GetOrigin(): string
{
return $this->sOrigin;
}

View File

@@ -46,7 +46,7 @@ class CaseLogEntry extends ActivityEntry
/** @var string $sAttCode Code of the corresponding case log attribute */
protected $sAttCode;
/** @var int $iCaseLogRank Rank of its case log in the host panel, can be used for highlight purposes for example */
protected $iCaseLogRank;
protected $iCaseLogRank;
/** @var string $sAuthorName Fallback name used if $sAuthorLogin is empty */
protected $sAuthorName;
@@ -104,7 +104,7 @@ class CaseLogEntry extends ActivityEntry
*
* @return string
*/
public function GetAttCode()
public function GetAttCode(): string
{
return $this->sAttCode;
}
@@ -128,7 +128,7 @@ class CaseLogEntry extends ActivityEntry
*
* @return int
*/
public function GetCaseLogRank()
public function GetCaseLogRank(): int
{
return $this->iCaseLogRank;
}

View File

@@ -70,7 +70,7 @@ class EditsEntry extends ActivityEntry
*
* @return string
*/
public function GetObjectClass()
public function GetObjectClass(): string
{
return $this->sObjectClass;
}
@@ -94,7 +94,7 @@ class EditsEntry extends ActivityEntry
*
* @return array
*/
public function GetAttributes()
public function GetAttributes(): array
{
return $this->aAttributes;
}
@@ -175,7 +175,7 @@ class EditsEntry extends ActivityEntry
*
* @return string
*/
public function GetShortDescriptionAsHtml()
public function GetShortDescriptionAsHtml(): string
{
// We need the array to be indexed by numbers instead of being associative
$aAttributesData = array_values($this->GetAttributes());

View File

@@ -94,7 +94,7 @@ class TransitionEntry extends ActivityEntry
*
* @return string
*/
public function GetOriginalStateCode()
public function GetOriginalStateCode(): string
{
return $this->sOriginStateCode;
}
@@ -104,7 +104,7 @@ class TransitionEntry extends ActivityEntry
*
* @return string
*/
public function GetOriginalStateLabel()
public function GetOriginalStateLabel(): string
{
return $this->sOriginStateLabel;
}
@@ -131,7 +131,7 @@ class TransitionEntry extends ActivityEntry
*
* @return string
*/
public function GetTargetStateCode()
public function GetTargetStateCode(): string
{
return $this->sTargetStateCode;
}
@@ -141,7 +141,7 @@ class TransitionEntry extends ActivityEntry
*
* @return string
*/
public function GetTargetStateLabel()
public function GetTargetStateLabel(): string
{
return $this->sTargetStateLabel;
}