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

@@ -62,8 +62,10 @@ class TransitionEntry extends ActivityEntry
* @throws \CoreException
* @throws \OQLException
*/
public function __construct(DateTime $oDateTime, $sAuthorLogin, $sObjectClass, $sOriginStateCode, $sTargetStateCode, $sId = null)
{
public function __construct(
DateTime $oDateTime, string $sAuthorLogin, string $sObjectClass, string $sOriginStateCode, string $sTargetStateCode,
?string $sId = null
) {
parent::__construct($oDateTime, $sAuthorLogin, null, $sId);
$this->SetOriginalState($sObjectClass, $sOriginStateCode);
@@ -79,7 +81,7 @@ class TransitionEntry extends ActivityEntry
* @return $this
* @throws \CoreException
*/
public function SetOriginalState($sObjectClass, $sStateCode)
public function SetOriginalState(string $sObjectClass, string $sStateCode)
{
$this->sOriginStateCode = $sStateCode;
$this->sOriginStateLabel = MetaModel::GetStateLabel($sObjectClass, $sStateCode);
@@ -116,7 +118,7 @@ class TransitionEntry extends ActivityEntry
* @return $this
* @throws \CoreException
*/
public function SetTargetState($sObjectClass, $sStateCode)
public function SetTargetState(string $sObjectClass, string $sStateCode)
{
$this->sTargetStateCode = $sStateCode;
$this->sTargetStateLabel = MetaModel::GetStateLabel($sObjectClass, $sStateCode);