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

@@ -76,8 +76,10 @@ class DataTable extends UIContentBlock
/**
* @param mixed $sAjaxUrl
*
* @return $this
*/
public function SetAjaxUrl(string $sAjaxUrl): void
public function SetAjaxUrl(string $sAjaxUrl)
{
if (strlen($sAjaxUrl) > 0)
{
@@ -92,6 +94,8 @@ class DataTable extends UIContentBlock
{
$this->sAjaxUrl = $sAjaxUrl;
}
return $this;
}
/**

View File

@@ -25,7 +25,7 @@ class DataTableConfig extends UIContentBlock
/**
* @return \Combodo\iTop\Application\UI\Base\Component\DataTable\DataTable
*/
private function GetDataTable(): DataTable
private function GetDataTable()
{
return $this->oDataTable;
}

View File

@@ -49,9 +49,11 @@ class FormTable extends StaticTable
/**
* @param string $sRef
*/
public function SetRef(string $sRef): void
public function SetRef(string $sRef)
{
$this->sRef = $sRef;
return $this;
}
public function GetRows(): array
@@ -59,7 +61,7 @@ class FormTable extends StaticTable
return $this->aRows;
}
public function AddRow(FormTableRow $oRow): self
public function AddRow(FormTableRow $oRow)
{
$this->aRows[] = $oRow;
return $this;

View File

@@ -67,10 +67,14 @@ class FormTableRow extends UIBlock
/**
* @param string $sRef
*
* @return $this
*/
public function SetRef(string $sRef): void
public function SetRef(string $sRef)
{
$this->sRef = $sRef;
return $this;
}
/**
@@ -83,10 +87,14 @@ class FormTableRow extends UIBlock
/**
* @param array $aColumns
*
* @return $this
*/
public function SetColumns(array $aColumns): void
public function SetColumns(array $aColumns)
{
$this->aColumns = $aColumns;
return $this;
}
/**
@@ -99,10 +107,14 @@ class FormTableRow extends UIBlock
/**
* @param array $aData
*
* @return $this
*/
public function SetData(array $aData): void
public function SetData(array $aData)
{
$this->aData = $aData;
return $this;
}
/**
@@ -115,9 +127,13 @@ class FormTableRow extends UIBlock
/**
* @param int $iRowId
*
* @return $this
*/
public function SetRowId(int $iRowId): void
public function SetRowId(int $iRowId)
{
$this->iRowId = $iRowId;
return $this;
}
}

View File

@@ -82,10 +82,14 @@ class StaticTable extends UIContentBlock
/**
* @param array $aColumns
*
* @return $this
*/
public function SetColumns(array $aColumns): void
public function SetColumns(array $aColumns)
{
$this->aColumns = $aColumns;
return $this;
}
/**
@@ -98,18 +102,26 @@ class StaticTable extends UIContentBlock
/**
* @param array $aData
*
* @return $this
*/
public function SetData(array $aData): void
public function SetData(array $aData)
{
$this->aData = $aData;
return $this;
}
/**
* @param string $sFilter
*
* @return $this
*/
public function SetFilter($sFilter): void
public function SetFilter($sFilter)
{
$this->sFilter = $sFilter;
return $this;
}
public function GetJSRefresh(): string