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 <?php
use CRM_TwingleCampaign_Utils_ExtensionCache as Cache; 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_Campaign as Campaign;
use CRM_TwingleCampaign_BAO_TwingleApiCall as TwingleApiCall; use CRM_TwingleCampaign_BAO_TwingleApiCall as TwingleApiCall;
use CRM_TwingleCampaign_BAO_Configuration as Configuration; use CRM_TwingleCampaign_BAO_Configuration as Configuration;
@ -322,9 +323,6 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
* Matches a single string that should contain first and lastname to match a * 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. * 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 $names
* @param string $email * @param string $email
* *

View file

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

View file

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