code formatting

This commit is contained in:
Marc Michalsky forumZFD 2020-12-14 17:29:09 +01:00
parent 27ff763579
commit 59c9581bfb
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
3 changed files with 13 additions and 14 deletions

View file

@ -1,6 +1,7 @@
<?php
use CRM_TwingleCampaign_Utils_ExtensionCache as Cache;
use CRM_TwingleCampaign_Utils_StringOperations as StringOps;
use CRM_TwingleCampaign_BAO_Campaign as Campaign;
use CRM_TwingleCampaign_BAO_TwingleApiCall as TwingleApiCall;
use CRM_TwingleCampaign_BAO_Configuration as Configuration;
@ -199,11 +200,11 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
Configuration::get('twinglecampaign_start_case')
) {
$result = civicrm_api3('Case', 'create', [
'contact_id' => $formattedValues['contact_id'],
'contact_id' => $formattedValues['contact_id'],
'case_type_id' => Configuration::get('twinglecampaign_start_case'),
'subject' => $formattedValues['title'],
'start_date' => $formattedValues['created_at'],
'status_id' => "Open",
'subject' => $formattedValues['title'],
'start_date' => $formattedValues['created_at'],
'status_id' => "Open",
]);
}
@ -322,9 +323,6 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
* Matches a single string that should contain first and lastname to match a
* contact or create a new one if it does not exist yet.
*
* TODO: The logic of this method should instead be handled in the XCM
* extension. This ist only a temporary solution.
*
* @param string $names
* @param string $email
*

View file

@ -49,9 +49,9 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
*/
public static function sync(
array $values,
TwingleApiCall &$twingleApi,
TwingleApiCall $twingleApi,
bool $is_test = FALSE
) {
): ?array {
// If $values is an array
if (is_array($values)) {
@ -180,7 +180,7 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
}
}
// Return a response of the synchronization
// Return the result of the synchronization
return $result;
}
else {
@ -198,13 +198,13 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
*
* @throws Exception
*/
public function export() {
public function export(): array {
$values = $this->values;
self::formatValues($values, self::OUT);
// Get template for project
$project = Cache::getInstance()->getTemplates()['project'];
$project = Cache::getInstance()->getTemplates()['TwingleProject'];
// Replace array items which the Twingle API does not expect
foreach ($values as $key => $value) {
@ -229,7 +229,7 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
* @throws CiviCRM_API3_Exception
* @throws Exception
*/
public function create(bool $is_test = FALSE) {
public function create(bool $is_test = FALSE): array {
// Create campaign only if this is not a test
if (!$is_test) {
@ -345,7 +345,7 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
$this->values[$key] = $embedData[$key];
}
}
/**
* Deactivate this TwingleProject campaign

View file

@ -74,6 +74,7 @@ class CRM_TwingleCampaign_Utils_ExtensionCache {
protected function __clone() {}
/**
* Returns a mapping of all custom field of the TwingleCampaign extension
* @return array
*/
public function getCustomFieldMapping(): array {