improve method inheritance

This commit is contained in:
Marc Michalsky forumZFD 2020-12-17 09:10:40 +01:00
parent 986f70c454
commit a745081b35
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
3 changed files with 37 additions and 117 deletions

View file

@ -271,7 +271,7 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
/**
* Translate values between CiviCRM Campaigns and Twingle
* Translate values between CiviCRM Campaigns and Twingle format
*
* @param array $values
* array of which values shall be translated
@ -385,21 +385,6 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
}
/**
* Deactivate this TwingleProject campaign
*
* @return bool
* TRUE if deactivation was successful
*
* @throws CiviCRM_API3_Exception
*/
public function deactivate() {
return self::deactivateByid($this->id);
}
/**
* Get a response that describes the status of a TwingleProject
*
@ -409,7 +394,7 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
* @return array
* Returns a response array that contains title, id, project_id and status
*/
public function getResponse(string $status) {
public function getResponse(string $status): array {
$project_type = empty($this->values['type']) ? 'default' : $this->values['type'];
return [
'title' => $this->values['name'],
@ -423,7 +408,7 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
/**
* Return a timestamp of the last update of the Campaign
*
* @return int|null
* @return int|string|null
*/
public function lastUpdate() {
@ -436,7 +421,7 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
*
* @return int
*/
public function getProjectId() {
public function getProjectId(): int {
return (int) $this->values['id'];
}