Commit 7b966967 authored by Seamus Lee's avatar Seamus Lee

(NFC) Update CRM/Cxn CRM/Dashlet CRM/Export CRM/Extension and CRM/Financial...

(NFC) Update CRM/Cxn CRM/Dashlet CRM/Export CRM/Extension and CRM/Financial files to new coder style
parent fb1a4c6f
...@@ -165,7 +165,7 @@ class CRM_Cxn_BAO_Cxn extends CRM_Cxn_DAO_Cxn { ...@@ -165,7 +165,7 @@ class CRM_Cxn_BAO_Cxn extends CRM_Cxn_DAO_Cxn {
} }
/** /**
* @return DefaultCertificateValidator * @return \Civi\Cxn\Rpc\DefaultCertificateValidator
* @throws CRM_Core_Exception * @throws CRM_Core_Exception
*/ */
public static function createCertificateValidator() { public static function createCertificateValidator() {
......
...@@ -44,8 +44,9 @@ class CRM_Dashlet_Page_GettingStarted extends CRM_Core_Page { ...@@ -44,8 +44,9 @@ class CRM_Dashlet_Page_GettingStarted extends CRM_Core_Page {
/** /**
* Define tokens available for getting started * Define tokens available for getting started
* @var array
*/ */
static $_tokens = [ public static $_tokens = [
'crmurl' => [ 'crmurl' => [
'configbackend' => 'civicrm/admin/configtask', 'configbackend' => 'civicrm/admin/configtask',
], ],
...@@ -121,7 +122,6 @@ class CRM_Dashlet_Page_GettingStarted extends CRM_Core_Page { ...@@ -121,7 +122,6 @@ class CRM_Dashlet_Page_GettingStarted extends CRM_Core_Page {
return $html; return $html;
} }
/** /**
* @param array $tokensList * @param array $tokensList
* @param string $str * @param string $str
......
...@@ -47,7 +47,7 @@ class CRM_Export_BAO_Export { ...@@ -47,7 +47,7 @@ class CRM_Export_BAO_Export {
* @param int $exportMode * @param int $exportMode
* Export mode. * Export mode.
* *
* @return string $property * @return string
* Default Return property * Default Return property
*/ */
public static function defaultReturnProperty($exportMode) { public static function defaultReturnProperty($exportMode) {
...@@ -83,7 +83,7 @@ class CRM_Export_BAO_Export { ...@@ -83,7 +83,7 @@ class CRM_Export_BAO_Export {
* @param int $exportMode * @param int $exportMode
* Export mode. * Export mode.
* *
* @return string $component * @return string
* CiviCRM Export Component * CiviCRM Export Component
*/ */
public static function exportComponent($exportMode) { public static function exportComponent($exportMode) {
...@@ -120,7 +120,7 @@ class CRM_Export_BAO_Export { ...@@ -120,7 +120,7 @@ class CRM_Export_BAO_Export {
* @param object $query * @param object $query
* CRM_Contact_BAO_Query * CRM_Contact_BAO_Query
* *
* @return string $groupBy * @return string
* Group By Clause * Group By Clause
*/ */
public static function getGroupBy($processor, $returnProperties, $query) { public static function getGroupBy($processor, $returnProperties, $query) {
...@@ -1132,11 +1132,10 @@ LIMIT $offset, $limit ...@@ -1132,11 +1132,10 @@ LIMIT $offset, $limit
} }
// CRM-13995 // CRM-13995
elseif (is_object($relDAO) && in_array($relationField, [ elseif (is_object($relDAO) && in_array($relationField, [
'email_greeting', 'email_greeting',
'postal_greeting', 'postal_greeting',
'addressee', 'addressee',
]) ])) {
) {
//special case for greeting replacement //special case for greeting replacement
$fldValue = "{$relationField}_display"; $fldValue = "{$relationField}_display";
$fieldValue = $relDAO->$fldValue; $fieldValue = $relDAO->$fldValue;
......
...@@ -93,7 +93,7 @@ class CRM_Export_BAO_ExportProcessor { ...@@ -93,7 +93,7 @@ class CRM_Export_BAO_ExportProcessor {
* *
* e.g. ['8_b_a' => 'Household Member Is', '8_a_b = 'Household Member Of'.....] * e.g. ['8_b_a' => 'Household Member Is', '8_a_b = 'Household Member Of'.....]
* *
* @var * @var array
*/ */
protected $relationshipTypes = []; protected $relationshipTypes = [];
...@@ -168,6 +168,7 @@ class CRM_Export_BAO_ExportProcessor { ...@@ -168,6 +168,7 @@ class CRM_Export_BAO_ExportProcessor {
public function setIsPostalableOnly($isPostalableOnly) { public function setIsPostalableOnly($isPostalableOnly) {
$this->isPostalableOnly = $isPostalableOnly; $this->isPostalableOnly = $isPostalableOnly;
} }
/** /**
* @return array|null * @return array|null
*/ */
...@@ -313,7 +314,6 @@ class CRM_Export_BAO_ExportProcessor { ...@@ -313,7 +314,6 @@ class CRM_Export_BAO_ExportProcessor {
return array_key_exists($fieldName, $this->relationshipTypes); return array_key_exists($fieldName, $this->relationshipTypes);
} }
/** /**
* @param $fieldName * @param $fieldName
* @return bool * @return bool
...@@ -1002,7 +1002,7 @@ class CRM_Export_BAO_ExportProcessor { ...@@ -1002,7 +1002,7 @@ class CRM_Export_BAO_ExportProcessor {
$skippedFields = ($this->getQueryMode() === CRM_Contact_BAO_Query::MODE_CONTACTS) ? [] : [ $skippedFields = ($this->getQueryMode() === CRM_Contact_BAO_Query::MODE_CONTACTS) ? [] : [
'groups', 'groups',
'tags', 'tags',
'notes' 'notes',
]; ];
foreach ($fields as $key => $var) { foreach ($fields as $key => $var) {
......
...@@ -94,22 +94,21 @@ class CRM_Export_Form_Map extends CRM_Core_Form { ...@@ -94,22 +94,21 @@ class CRM_Export_Form_Map extends CRM_Core_Form {
); );
$this->addButtons([ $this->addButtons([
[ [
'type' => 'back', 'type' => 'back',
'name' => ts('Previous'), 'name' => ts('Previous'),
], ],
[ [
'type' => 'next', 'type' => 'next',
'name' => ts('Export'), 'name' => ts('Export'),
'spacing' => '          ', 'spacing' => '          ',
], ],
[ [
'type' => 'done', 'type' => 'done',
'icon' => 'fa-times', 'icon' => 'fa-times',
'name' => ts('Done'), 'name' => ts('Done'),
], ],
] ]);
);
} }
/** /**
......
...@@ -142,7 +142,8 @@ class CRM_Export_Form_Select extends CRM_Core_Form_Task { ...@@ -142,7 +142,8 @@ class CRM_Export_Form_Select extends CRM_Core_Form_Task {
if ($formName == 'CRM_Export_StateMachine_Standalone') { if ($formName == 'CRM_Export_StateMachine_Standalone') {
$componentName = ['CRM', $this->controller->get('entity')]; $componentName = ['CRM', $this->controller->get('entity')];
} }
$entityShortname = $componentName[1]; // Contact // Contact
$entityShortname = $componentName[1];
$entityDAOName = $entityShortname; $entityDAOName = $entityShortname;
break; break;
} }
...@@ -316,18 +317,17 @@ FROM {$this->_componentTable} ...@@ -316,18 +317,17 @@ FROM {$this->_componentTable}
]); ]);
$this->addButtons([ $this->addButtons([
[ [
'type' => 'next', 'type' => 'next',
'name' => ts('Continue'), 'name' => ts('Continue'),
'spacing' => '          ', 'spacing' => '          ',
'isDefault' => TRUE, 'isDefault' => TRUE,
], ],
[ [
'type' => 'cancel', 'type' => 'cancel',
'name' => ts('Cancel'), 'name' => ts('Cancel'),
], ],
] ]);
);
$this->addFormRule(['CRM_Export_Form_Select', 'formRule'], $this); $this->addFormRule(['CRM_Export_Form_Select', 'formRule'], $this);
} }
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
* scanned for extensions. * scanned for extensions.
*/ */
class CRM_Extension_Container_Static implements CRM_Extension_Container_Interface { class CRM_Extension_Container_Static implements CRM_Extension_Container_Interface {
/** /**
* @param array $exts * @param array $exts
* Array(string $key => array $spec) List of extensions. * Array(string $key => array $spec) List of extensions.
......
...@@ -38,6 +38,9 @@ class CRM_Extension_Info { ...@@ -38,6 +38,9 @@ class CRM_Extension_Info {
*/ */
const FILENAME = 'info.xml'; const FILENAME = 'info.xml';
/**
* @var string
*/
public $key = NULL; public $key = NULL;
public $type = NULL; public $type = NULL;
public $name = NULL; public $name = NULL;
......
...@@ -135,7 +135,8 @@ class CRM_Extension_Manager { ...@@ -135,7 +135,8 @@ class CRM_Extension_Manager {
case self::STATUS_INSTALLED: case self::STATUS_INSTALLED:
case self::STATUS_DISABLED: case self::STATUS_DISABLED:
// There is an old copy of the extension. Try to install in the same place -- but it must go somewhere in the default-container // There is an old copy of the extension. Try to install in the same place -- but it must go somewhere in the default-container
list ($oldInfo, $typeManager) = $this->_getInfoTypeHandler($newInfo->key); // throws Exception // throws Exception
list ($oldInfo, $typeManager) = $this->_getInfoTypeHandler($newInfo->key);
$tgtPath = $this->fullContainer->getPath($newInfo->key); $tgtPath = $this->fullContainer->getPath($newInfo->key);
if (!CRM_Utils_File::isChildPath($this->defaultContainer->getBaseDir(), $tgtPath)) { if (!CRM_Utils_File::isChildPath($this->defaultContainer->getBaseDir(), $tgtPath)) {
// force installation in the default-container // force installation in the default-container
...@@ -152,7 +153,8 @@ class CRM_Extension_Manager { ...@@ -152,7 +153,8 @@ class CRM_Extension_Manager {
case self::STATUS_DISABLED_MISSING: case self::STATUS_DISABLED_MISSING:
// the extension does not exist in any container; we're free to put it anywhere // the extension does not exist in any container; we're free to put it anywhere
$tgtPath = $this->defaultContainer->getBaseDir() . DIRECTORY_SEPARATOR . $newInfo->key; $tgtPath = $this->defaultContainer->getBaseDir() . DIRECTORY_SEPARATOR . $newInfo->key;
list ($oldInfo, $typeManager) = $this->_getMissingInfoTypeHandler($newInfo->key); // throws Exception // throws Exception
list ($oldInfo, $typeManager) = $this->_getMissingInfoTypeHandler($newInfo->key);
break; break;
case self::STATUS_UNKNOWN: case self::STATUS_UNKNOWN:
...@@ -210,7 +212,8 @@ class CRM_Extension_Manager { ...@@ -210,7 +212,8 @@ class CRM_Extension_Manager {
// keys/statuses/types before doing anything // keys/statuses/types before doing anything
foreach ($keys as $key) { foreach ($keys as $key) {
list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception // throws Exception
list ($info, $typeManager) = $this->_getInfoTypeHandler($key);
switch ($origStatuses[$key]) { switch ($origStatuses[$key]) {
case self::STATUS_INSTALLED: case self::STATUS_INSTALLED:
...@@ -254,7 +257,8 @@ class CRM_Extension_Manager { ...@@ -254,7 +257,8 @@ class CRM_Extension_Manager {
$schema->fixSchemaDifferences(); $schema->fixSchemaDifferences();
foreach ($keys as $key) { foreach ($keys as $key) {
list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception // throws Exception
list ($info, $typeManager) = $this->_getInfoTypeHandler($key);
switch ($origStatuses[$key]) { switch ($origStatuses[$key]) {
case self::STATUS_INSTALLED: case self::STATUS_INSTALLED:
...@@ -304,7 +308,8 @@ class CRM_Extension_Manager { ...@@ -304,7 +308,8 @@ class CRM_Extension_Manager {
sort($keys); sort($keys);
$disableRequirements = $this->findDisableRequirements($keys); $disableRequirements = $this->findDisableRequirements($keys);
sort($disableRequirements); // This munges order, but makes it comparable. // This munges order, but makes it comparable.
sort($disableRequirements);
if ($keys !== $disableRequirements) { if ($keys !== $disableRequirements) {
throw new CRM_Extension_Exception_DependencyException("Cannot disable extension due dependencies. Consider disabling all these: " . implode(',', $disableRequirements)); throw new CRM_Extension_Exception_DependencyException("Cannot disable extension due dependencies. Consider disabling all these: " . implode(',', $disableRequirements));
} }
...@@ -312,14 +317,16 @@ class CRM_Extension_Manager { ...@@ -312,14 +317,16 @@ class CRM_Extension_Manager {
foreach ($keys as $key) { foreach ($keys as $key) {
switch ($origStatuses[$key]) { switch ($origStatuses[$key]) {
case self::STATUS_INSTALLED: case self::STATUS_INSTALLED:
list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception // throws Exception
list ($info, $typeManager) = $this->_getInfoTypeHandler($key);
$typeManager->onPreDisable($info); $typeManager->onPreDisable($info);
$this->_setExtensionActive($info, 0); $this->_setExtensionActive($info, 0);
$typeManager->onPostDisable($info); $typeManager->onPostDisable($info);
break; break;
case self::STATUS_INSTALLED_MISSING: case self::STATUS_INSTALLED_MISSING:
list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key); // throws Exception // throws Exception
list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key);
$typeManager->onPreDisable($info); $typeManager->onPreDisable($info);
$this->_setExtensionActive($info, 0); $this->_setExtensionActive($info, 0);
$typeManager->onPostDisable($info); $typeManager->onPostDisable($info);
...@@ -364,14 +371,16 @@ class CRM_Extension_Manager { ...@@ -364,14 +371,16 @@ class CRM_Extension_Manager {
throw new CRM_Extension_Exception("Cannot uninstall extension; disable it first: $key"); throw new CRM_Extension_Exception("Cannot uninstall extension; disable it first: $key");
case self::STATUS_DISABLED: case self::STATUS_DISABLED:
list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception // throws Exception
list ($info, $typeManager) = $this->_getInfoTypeHandler($key);
$typeManager->onPreUninstall($info); $typeManager->onPreUninstall($info);
$this->_removeExtensionEntry($info); $this->_removeExtensionEntry($info);
$typeManager->onPostUninstall($info); $typeManager->onPostUninstall($info);
break; break;
case self::STATUS_DISABLED_MISSING: case self::STATUS_DISABLED_MISSING:
list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key); // throws Exception // throws Exception
list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key);
$typeManager->onPreUninstall($info); $typeManager->onPreUninstall($info);
$this->_removeExtensionEntry($info); $this->_removeExtensionEntry($info);
$typeManager->onPostUninstall($info); $typeManager->onPostUninstall($info);
...@@ -450,7 +459,8 @@ class CRM_Extension_Manager { ...@@ -450,7 +459,8 @@ class CRM_Extension_Manager {
public function refresh() { public function refresh() {
$this->statuses = NULL; $this->statuses = NULL;
$this->fullContainer->refresh(); // and, indirectly, defaultContainer // and, indirectly, defaultContainer
$this->fullContainer->refresh();
$this->mapper->refresh(); $this->mapper->refresh();
} }
...@@ -466,7 +476,8 @@ class CRM_Extension_Manager { ...@@ -466,7 +476,8 @@ class CRM_Extension_Manager {
* (0 => CRM_Extension_Info, 1 => CRM_Extension_Manager_Interface) * (0 => CRM_Extension_Info, 1 => CRM_Extension_Manager_Interface)
*/ */
private function _getInfoTypeHandler($key) { private function _getInfoTypeHandler($key) {
$info = $this->mapper->keyToInfo($key); // throws Exception // throws Exception
$info = $this->mapper->keyToInfo($key);
if (array_key_exists($info->type, $this->typeManagers)) { if (array_key_exists($info->type, $this->typeManagers)) {
return [$info, $this->typeManagers[$info->type]]; return [$info, $this->typeManagers[$info->type]];
} }
...@@ -595,8 +606,10 @@ class CRM_Extension_Manager { ...@@ -595,8 +606,10 @@ class CRM_Extension_Manager {
*/ */
public function findInstallRequirements($keys) { public function findInstallRequirements($keys) {
$infos = $this->mapper->getAllInfos(); $infos = $this->mapper->getAllInfos();
$todoKeys = array_unique($keys); // array(string $key). // array(string $key).
$doneKeys = []; // array(string $key => 1); $todoKeys = array_unique($keys);
// array(string $key => 1);
$doneKeys = [];
$sorter = new \MJS\TopSort\Implementations\FixedArraySort(); $sorter = new \MJS\TopSort\Implementations\FixedArraySort();
while (!empty($todoKeys)) { while (!empty($todoKeys)) {
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
* @copyright CiviCRM LLC (c) 2004-2019 * @copyright CiviCRM LLC (c) 2004-2019
*/ */
interface CRM_Extension_Manager_Interface { interface CRM_Extension_Manager_Interface {
/** /**
* Perform type-specific installation logic (before marking the * Perform type-specific installation logic (before marking the
* extension as installed or clearing the caches). * extension as installed or clearing the caches).
......
...@@ -205,10 +205,10 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base { ...@@ -205,10 +205,10 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
$file = $this->mapper->classToPath($paymentClass); $file = $this->mapper->classToPath($paymentClass);
if (!file_exists($file)) { if (!file_exists($file)) {
CRM_Core_Session::setStatus(ts('Failed to load file (%3) for payment processor (%1) while running "%2"', [ CRM_Core_Session::setStatus(ts('Failed to load file (%3) for payment processor (%1) while running "%2"', [
1 => $info->key, 1 => $info->key,
2 => $method, 2 => $method,
3 => $file, 3 => $file,
]), '', 'error'); ]), '', 'error');
return; return;
} }
else { else {
...@@ -217,9 +217,9 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base { ...@@ -217,9 +217,9 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
} }
catch (CRM_Extension_Exception $e) { catch (CRM_Extension_Exception $e) {
CRM_Core_Session::setStatus(ts('Failed to determine file path for payment processor (%1) while running "%2"', [ CRM_Core_Session::setStatus(ts('Failed to determine file path for payment processor (%1) while running "%2"', [
1 => $info->key, 1 => $info->key,
2 => $method, 2 => $method,
]), '', 'error'); ]), '', 'error');
return; return;
} }
...@@ -263,10 +263,9 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base { ...@@ -263,10 +263,9 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base {
// Does PP implement this method, and can we call it? // Does PP implement this method, and can we call it?
if (method_exists($processorInstance, $method) && is_callable([ if (method_exists($processorInstance, $method) && is_callable([
$processorInstance, $processorInstance,
$method, $method,
]) ])) {
) {
// If so, call it ... // If so, call it ...
$processorInstance->$method(); $processorInstance->$method();
} }
......
...@@ -109,7 +109,8 @@ class CRM_Extension_System { ...@@ -109,7 +109,8 @@ class CRM_Extension_System {
if (!array_key_exists('domain_id', $parameters)) { if (!array_key_exists('domain_id', $parameters)) {
$parameters['domain_id'] = CRM_Core_Config::domainID(); $parameters['domain_id'] = CRM_Core_Config::domainID();
} }
ksort($parameters); // guaranteed ordering - useful for md5(serialize($parameters)) // guaranteed ordering - useful for md5(serialize($parameters))
ksort($parameters);
$this->parameters = $parameters; $this->parameters = $parameters;
} }
...@@ -243,7 +244,8 @@ class CRM_Extension_System { ...@@ -243,7 +244,8 @@ class CRM_Extension_System {
$this->downloader = new CRM_Extension_Downloader( $this->downloader = new CRM_Extension_Downloader(
$this->getManager(), $this->getManager(),
$basedir, $basedir,
CRM_Utils_File::tempdir() // WAS: $config->extensionsDir . DIRECTORY_SEPARATOR . 'tmp'; // WAS: $config->extensionsDir . DIRECTORY_SEPARATOR . 'tmp';
CRM_Utils_File::tempdir()
); );
} }
return $this->downloader; return $this->downloader;
...@@ -323,7 +325,8 @@ class CRM_Extension_System { ...@@ -323,7 +325,8 @@ class CRM_Extension_System {
switch ($extensionRow['status']) { switch ($extensionRow['status']) {
case CRM_Extension_Manager::STATUS_UNINSTALLED: case CRM_Extension_Manager::STATUS_UNINSTALLED:
$extensionRow['statusLabel'] = ''; // ts('Uninstalled'); // ts('Uninstalled');
$extensionRow['statusLabel'] = '';
break; break;
case CRM_Extension_Manager::STATUS_DISABLED: case CRM_Extension_Manager::STATUS_DISABLED:
...@@ -331,7 +334,8 @@ class CRM_Extension_System { ...@@ -331,7 +334,8 @@ class CRM_Extension_System {
break; break;
case CRM_Extension_Manager::STATUS_INSTALLED: case CRM_Extension_Manager::STATUS_INSTALLED:
$extensionRow['statusLabel'] = ts('Enabled'); // ts('Installed'); // ts('Installed');
$extensionRow['statusLabel'] = ts('Enabled');
break; break;
case CRM_Extension_Manager::STATUS_DISABLED_MISSING: case CRM_Extension_Manager::STATUS_DISABLED_MISSING:
...@@ -339,7 +343,8 @@ class CRM_Extension_System { ...@@ -339,7 +343,8 @@ class CRM_Extension_System {
break; break;
case CRM_Extension_Manager::STATUS_INSTALLED_MISSING: case CRM_Extension_Manager::STATUS_INSTALLED_MISSING:
$extensionRow['statusLabel'] = ts('Enabled (Missing)'); // ts('Installed'); // ts('Installed');
$extensionRow['statusLabel'] = ts('Enabled (Missing)');
break; break;
default: default:
......
...@@ -91,7 +91,7 @@ abstract class CRM_Financial_BAO_ExportFormat { ...@@ -91,7 +91,7 @@ abstract class CRM_Financial_BAO_ExportFormat {
* *
* @param $exportDaos array with DAO's for queries to be exported. * @param $exportDaos array with DAO's for queries to be exported.
*/ */
public abstract function makeExport($exportDaos); abstract public function makeExport($exportDaos);
/** /**
* @return string * @return string
...@@ -108,7 +108,7 @@ abstract class CRM_Financial_BAO_ExportFormat { ...@@ -108,7 +108,7 @@ abstract class CRM_Financial_BAO_ExportFormat {
* *
* @return string * @return string
*/ */
public abstract function getFileExtension(); abstract public function getFileExtension();
/** /**
* @return object * @return object
...@@ -131,6 +131,7 @@ abstract class CRM_Financial_BAO_ExportFormat { ...@@ -131,6 +131,7 @@ abstract class CRM_Financial_BAO_ExportFormat {
* Depending on the output format might want to override this, e.g. for IIF tabs need to be escaped etc, * Depending on the output format might want to override this, e.g. for IIF tabs need to be escaped etc,
* but for CSV it doesn't make sense because php has built in csv output functions. * but for CSV it doesn't make sense because php has built in csv output functions.
*/ */
/** /**
* @param $s * @param $s
* @param string $type * @param string $type
...@@ -162,7 +163,8 @@ abstract class CRM_Financial_BAO_ExportFormat { ...@@ -162,7 +163,8 @@ abstract class CRM_Financial_BAO_ExportFormat {
ob_clean(); ob_clean();
flush(); flush();
readfile($config->customFileUploadDir . CRM_Utils_File::cleanFileName(basename($zip))); readfile($config->customFileUploadDir . CRM_Utils_File::cleanFileName(basename($zip)));
unlink($zip); //delete the zip to avoid clutter. //delete the zip to avoid clutter.
unlink($zip);
CRM_Utils_System::civiExit(); CRM_Utils_System::civiExit();
} }
} }
......
...@@ -41,6 +41,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat ...@@ -41,6 +41,7 @@ class CRM_Financial_BAO_ExportFormat_CSV extends CRM_Financial_BAO_ExportFormat
* referenced in the journal entries that isn't defined anywhere. * referenced in the journal entries that isn't defined anywhere.
* *
* Possibly in the future this could be selected by the user. * Possibly in the future this could be selected by the user.
* @var array
*/ */
public static $complementaryTables = [ public static $complementaryTables = [
'ACCNT', 'ACCNT',
......
...@@ -39,14 +39,16 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat ...@@ -39,14 +39,16 @@ class CRM_Financial_BAO_ExportFormat_IIF extends CRM_Financial_BAO_ExportFormat
/** /**
* Tab character. Some people's editors replace tabs with spaces so I'm scared to use actual tabs. * Tab character. Some people's editors replace tabs with spaces so I'm scared to use actual tabs.
* Can't set it here using chr() because static. Same thing if a const. So it's set in constructor. * Can't set it here using chr() because static. Same thing if a const. So it's set in constructor.
* @var string
*/ */
static $SEPARATOR; public static $SEPARATOR;
/** /**
* For this phase, we always output these records too so that there isn't data * For this phase, we always output these records too so that there isn't data
* referenced in the journal entries that isn't defined anywhere. * referenced in the journal entries that isn't defined anywhere.
* *
* Possibly in the future this could be selected by the user. * Possibly in the future this could be selected by the user.
* @var array
*/ */
public static $complementaryTables = [ public static $complementaryTables = [
'ACCNT', 'ACCNT',
......
...@@ -34,12 +34,15 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { ...@@ -34,12 +34,15 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType {
/** /**
* Static cache holder of available financial types for this session * Static cache holder of available financial types for this session
* @var array
*/ */
static $_availableFinancialTypes = []; public static $_availableFinancialTypes = [];
/** /**
* Static cache holder of status of ACL-FT enabled/disabled for this session * Static cache holder of status of ACL-FT enabled/disabled for this session
* @var array
*/ */
static $_statusACLFt = []; public static $_statusACLFt = [];
/** /**
* Class constructor. * Class constructor.
......
...@@ -205,6 +205,7 @@ class CRM_Financial_BAO_Payment { ...@@ -205,6 +205,7 @@ class CRM_Financial_BAO_Payment {
]); ]);
return (int) $contribution['contact_id']; return (int) $contribution['contact_id'];
} }
/** /**
* @param array $entities * @param array $entities
* Related entities as an array keyed by the various entities. * Related entities as an array keyed by the various entities.
...@@ -268,7 +269,7 @@ class CRM_Financial_BAO_Payment { ...@@ -268,7 +269,7 @@ class CRM_Financial_BAO_Payment {
'refundAmount', 'refundAmount',
'totalPaid', 'totalPaid',
'paymentsComplete', 'paymentsComplete',
'emailGreeting' 'emailGreeting',
]; ];
// These are assigned by the payment form - they still 'get through' from the // These are assigned by the payment form - they still 'get through' from the
// form for now without being in here but we should ideally load // form for now without being in here but we should ideally load
......
...@@ -37,8 +37,9 @@ ...@@ -37,8 +37,9 @@
class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor { class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor {
/**