code formatting
This commit is contained in:
parent
27ff763579
commit
59c9581bfb
3 changed files with 13 additions and 14 deletions
|
@ -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;
|
||||
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue