From 7b966967b7b35ea0b71407390e8a0cfefc46d7cd Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 10 Apr 2019 11:21:31 +1000 Subject: [PATCH] (NFC) Update CRM/Cxn CRM/Dashlet CRM/Export CRM/Extension and CRM/Financial files to new coder style --- CRM/Cxn/BAO/Cxn.php | 2 +- CRM/Dashlet/Page/GettingStarted.php | 4 +-- CRM/Export/BAO/Export.php | 15 ++++---- CRM/Export/BAO/ExportProcessor.php | 6 ++-- CRM/Export/Form/Map.php | 31 ++++++++-------- CRM/Export/Form/Select.php | 26 +++++++------- CRM/Extension/Container/Static.php | 1 + CRM/Extension/Info.php | 3 ++ CRM/Extension/Manager.php | 39 ++++++++++++++------- CRM/Extension/Manager/Interface.php | 1 + CRM/Extension/Manager/Payment.php | 21 ++++++----- CRM/Extension/System.php | 15 +++++--- CRM/Financial/BAO/ExportFormat.php | 8 +++-- CRM/Financial/BAO/ExportFormat/CSV.php | 1 + CRM/Financial/BAO/ExportFormat/IIF.php | 4 ++- CRM/Financial/BAO/FinancialType.php | 7 ++-- CRM/Financial/BAO/Payment.php | 3 +- CRM/Financial/BAO/PaymentProcessor.php | 3 +- CRM/Financial/BAO/PaymentProcessorType.php | 5 +-- CRM/Financial/Form/BatchTransaction.php | 8 ++--- CRM/Financial/Form/Export.php | 4 +++ CRM/Financial/Form/FinancialAccount.php | 1 - CRM/Financial/Form/FinancialTypeAccount.php | 31 ++++++++-------- CRM/Financial/Form/PaymentEdit.php | 1 + CRM/Financial/Form/SalesTaxTrait.php | 1 - CRM/Financial/Page/Batch.php | 2 +- CRM/Financial/Page/BatchTransaction.php | 11 +++--- CRM/Financial/Page/FinancialAccount.php | 2 +- CRM/Financial/Page/FinancialBatch.php | 3 +- CRM/Financial/Page/FinancialType.php | 2 +- CRM/Financial/Page/FinancialTypeAccount.php | 5 +-- 31 files changed, 150 insertions(+), 116 deletions(-) diff --git a/CRM/Cxn/BAO/Cxn.php b/CRM/Cxn/BAO/Cxn.php index 156ccfb839..658bd61fc6 100644 --- a/CRM/Cxn/BAO/Cxn.php +++ b/CRM/Cxn/BAO/Cxn.php @@ -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 */ public static function createCertificateValidator() { diff --git a/CRM/Dashlet/Page/GettingStarted.php b/CRM/Dashlet/Page/GettingStarted.php index 29d1e10580..d9d44fba99 100644 --- a/CRM/Dashlet/Page/GettingStarted.php +++ b/CRM/Dashlet/Page/GettingStarted.php @@ -44,8 +44,9 @@ class CRM_Dashlet_Page_GettingStarted extends CRM_Core_Page { /** * Define tokens available for getting started + * @var array */ - static $_tokens = [ + public static $_tokens = [ 'crmurl' => [ 'configbackend' => 'civicrm/admin/configtask', ], @@ -121,7 +122,6 @@ class CRM_Dashlet_Page_GettingStarted extends CRM_Core_Page { return $html; } - /** * @param array $tokensList * @param string $str diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index ceaa4cb4ab..778ac58c90 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -47,7 +47,7 @@ class CRM_Export_BAO_Export { * @param int $exportMode * Export mode. * - * @return string $property + * @return string * Default Return property */ public static function defaultReturnProperty($exportMode) { @@ -83,7 +83,7 @@ class CRM_Export_BAO_Export { * @param int $exportMode * Export mode. * - * @return string $component + * @return string * CiviCRM Export Component */ public static function exportComponent($exportMode) { @@ -120,7 +120,7 @@ class CRM_Export_BAO_Export { * @param object $query * CRM_Contact_BAO_Query * - * @return string $groupBy + * @return string * Group By Clause */ public static function getGroupBy($processor, $returnProperties, $query) { @@ -1132,11 +1132,10 @@ LIMIT $offset, $limit } // CRM-13995 elseif (is_object($relDAO) && in_array($relationField, [ - 'email_greeting', - 'postal_greeting', - 'addressee', - ]) - ) { + 'email_greeting', + 'postal_greeting', + 'addressee', + ])) { //special case for greeting replacement $fldValue = "{$relationField}_display"; $fieldValue = $relDAO->$fldValue; diff --git a/CRM/Export/BAO/ExportProcessor.php b/CRM/Export/BAO/ExportProcessor.php index 6efa6bd413..2e8513c831 100644 --- a/CRM/Export/BAO/ExportProcessor.php +++ b/CRM/Export/BAO/ExportProcessor.php @@ -93,7 +93,7 @@ class CRM_Export_BAO_ExportProcessor { * * e.g. ['8_b_a' => 'Household Member Is', '8_a_b = 'Household Member Of'.....] * - * @var + * @var array */ protected $relationshipTypes = []; @@ -168,6 +168,7 @@ class CRM_Export_BAO_ExportProcessor { public function setIsPostalableOnly($isPostalableOnly) { $this->isPostalableOnly = $isPostalableOnly; } + /** * @return array|null */ @@ -313,7 +314,6 @@ class CRM_Export_BAO_ExportProcessor { return array_key_exists($fieldName, $this->relationshipTypes); } - /** * @param $fieldName * @return bool @@ -1002,7 +1002,7 @@ class CRM_Export_BAO_ExportProcessor { $skippedFields = ($this->getQueryMode() === CRM_Contact_BAO_Query::MODE_CONTACTS) ? [] : [ 'groups', 'tags', - 'notes' + 'notes', ]; foreach ($fields as $key => $var) { diff --git a/CRM/Export/Form/Map.php b/CRM/Export/Form/Map.php index 0d4b16235d..60d6002dff 100644 --- a/CRM/Export/Form/Map.php +++ b/CRM/Export/Form/Map.php @@ -94,22 +94,21 @@ class CRM_Export_Form_Map extends CRM_Core_Form { ); $this->addButtons([ - [ - 'type' => 'back', - 'name' => ts('Previous'), - ], - [ - 'type' => 'next', - 'name' => ts('Export'), - 'spacing' => '          ', - ], - [ - 'type' => 'done', - 'icon' => 'fa-times', - 'name' => ts('Done'), - ], - ] - ); + [ + 'type' => 'back', + 'name' => ts('Previous'), + ], + [ + 'type' => 'next', + 'name' => ts('Export'), + 'spacing' => '          ', + ], + [ + 'type' => 'done', + 'icon' => 'fa-times', + 'name' => ts('Done'), + ], + ]); } /** diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php index 5ce06d9976..7395ac1672 100644 --- a/CRM/Export/Form/Select.php +++ b/CRM/Export/Form/Select.php @@ -142,7 +142,8 @@ class CRM_Export_Form_Select extends CRM_Core_Form_Task { if ($formName == 'CRM_Export_StateMachine_Standalone') { $componentName = ['CRM', $this->controller->get('entity')]; } - $entityShortname = $componentName[1]; // Contact + // Contact + $entityShortname = $componentName[1]; $entityDAOName = $entityShortname; break; } @@ -316,18 +317,17 @@ FROM {$this->_componentTable} ]); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Continue'), - 'spacing' => '          ', - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Continue'), + 'spacing' => '          ', + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); $this->addFormRule(['CRM_Export_Form_Select', 'formRule'], $this); } diff --git a/CRM/Extension/Container/Static.php b/CRM/Extension/Container/Static.php index d0d6c55a9d..d0f994bb08 100644 --- a/CRM/Extension/Container/Static.php +++ b/CRM/Extension/Container/Static.php @@ -35,6 +35,7 @@ * scanned for extensions. */ class CRM_Extension_Container_Static implements CRM_Extension_Container_Interface { + /** * @param array $exts * Array(string $key => array $spec) List of extensions. diff --git a/CRM/Extension/Info.php b/CRM/Extension/Info.php index 06b40588ec..263ef1e644 100644 --- a/CRM/Extension/Info.php +++ b/CRM/Extension/Info.php @@ -38,6 +38,9 @@ class CRM_Extension_Info { */ const FILENAME = 'info.xml'; + /** + * @var string + */ public $key = NULL; public $type = NULL; public $name = NULL; diff --git a/CRM/Extension/Manager.php b/CRM/Extension/Manager.php index 6524c0a16f..7770d5a8e1 100644 --- a/CRM/Extension/Manager.php +++ b/CRM/Extension/Manager.php @@ -135,7 +135,8 @@ class CRM_Extension_Manager { case self::STATUS_INSTALLED: 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 - list ($oldInfo, $typeManager) = $this->_getInfoTypeHandler($newInfo->key); // throws Exception + // throws Exception + list ($oldInfo, $typeManager) = $this->_getInfoTypeHandler($newInfo->key); $tgtPath = $this->fullContainer->getPath($newInfo->key); if (!CRM_Utils_File::isChildPath($this->defaultContainer->getBaseDir(), $tgtPath)) { // force installation in the default-container @@ -152,7 +153,8 @@ class CRM_Extension_Manager { case self::STATUS_DISABLED_MISSING: // the extension does not exist in any container; we're free to put it anywhere $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; case self::STATUS_UNKNOWN: @@ -210,7 +212,8 @@ class CRM_Extension_Manager { // keys/statuses/types before doing anything foreach ($keys as $key) { - list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception + // throws Exception + list ($info, $typeManager) = $this->_getInfoTypeHandler($key); switch ($origStatuses[$key]) { case self::STATUS_INSTALLED: @@ -254,7 +257,8 @@ class CRM_Extension_Manager { $schema->fixSchemaDifferences(); foreach ($keys as $key) { - list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception + // throws Exception + list ($info, $typeManager) = $this->_getInfoTypeHandler($key); switch ($origStatuses[$key]) { case self::STATUS_INSTALLED: @@ -304,7 +308,8 @@ class CRM_Extension_Manager { sort($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) { 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 { foreach ($keys as $key) { switch ($origStatuses[$key]) { case self::STATUS_INSTALLED: - list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception + // throws Exception + list ($info, $typeManager) = $this->_getInfoTypeHandler($key); $typeManager->onPreDisable($info); $this->_setExtensionActive($info, 0); $typeManager->onPostDisable($info); break; case self::STATUS_INSTALLED_MISSING: - list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key); // throws Exception + // throws Exception + list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key); $typeManager->onPreDisable($info); $this->_setExtensionActive($info, 0); $typeManager->onPostDisable($info); @@ -364,14 +371,16 @@ class CRM_Extension_Manager { throw new CRM_Extension_Exception("Cannot uninstall extension; disable it first: $key"); case self::STATUS_DISABLED: - list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception + // throws Exception + list ($info, $typeManager) = $this->_getInfoTypeHandler($key); $typeManager->onPreUninstall($info); $this->_removeExtensionEntry($info); $typeManager->onPostUninstall($info); break; case self::STATUS_DISABLED_MISSING: - list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key); // throws Exception + // throws Exception + list ($info, $typeManager) = $this->_getMissingInfoTypeHandler($key); $typeManager->onPreUninstall($info); $this->_removeExtensionEntry($info); $typeManager->onPostUninstall($info); @@ -450,7 +459,8 @@ class CRM_Extension_Manager { public function refresh() { $this->statuses = NULL; - $this->fullContainer->refresh(); // and, indirectly, defaultContainer + // and, indirectly, defaultContainer + $this->fullContainer->refresh(); $this->mapper->refresh(); } @@ -466,7 +476,8 @@ class CRM_Extension_Manager { * (0 => CRM_Extension_Info, 1 => CRM_Extension_Manager_Interface) */ 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)) { return [$info, $this->typeManagers[$info->type]]; } @@ -595,8 +606,10 @@ class CRM_Extension_Manager { */ public function findInstallRequirements($keys) { $infos = $this->mapper->getAllInfos(); - $todoKeys = array_unique($keys); // array(string $key). - $doneKeys = []; // array(string $key => 1); + // array(string $key). + $todoKeys = array_unique($keys); + // array(string $key => 1); + $doneKeys = []; $sorter = new \MJS\TopSort\Implementations\FixedArraySort(); while (!empty($todoKeys)) { diff --git a/CRM/Extension/Manager/Interface.php b/CRM/Extension/Manager/Interface.php index b20e0eaddc..db5fc3f82a 100644 --- a/CRM/Extension/Manager/Interface.php +++ b/CRM/Extension/Manager/Interface.php @@ -33,6 +33,7 @@ * @copyright CiviCRM LLC (c) 2004-2019 */ interface CRM_Extension_Manager_Interface { + /** * Perform type-specific installation logic (before marking the * extension as installed or clearing the caches). diff --git a/CRM/Extension/Manager/Payment.php b/CRM/Extension/Manager/Payment.php index 9d2349a7f4..fb8417f294 100644 --- a/CRM/Extension/Manager/Payment.php +++ b/CRM/Extension/Manager/Payment.php @@ -205,10 +205,10 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base { $file = $this->mapper->classToPath($paymentClass); if (!file_exists($file)) { CRM_Core_Session::setStatus(ts('Failed to load file (%3) for payment processor (%1) while running "%2"', [ - 1 => $info->key, - 2 => $method, - 3 => $file, - ]), '', 'error'); + 1 => $info->key, + 2 => $method, + 3 => $file, + ]), '', 'error'); return; } else { @@ -217,9 +217,9 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base { } catch (CRM_Extension_Exception $e) { CRM_Core_Session::setStatus(ts('Failed to determine file path for payment processor (%1) while running "%2"', [ - 1 => $info->key, - 2 => $method, - ]), '', 'error'); + 1 => $info->key, + 2 => $method, + ]), '', 'error'); return; } @@ -263,10 +263,9 @@ class CRM_Extension_Manager_Payment extends CRM_Extension_Manager_Base { // Does PP implement this method, and can we call it? if (method_exists($processorInstance, $method) && is_callable([ - $processorInstance, - $method, - ]) - ) { + $processorInstance, + $method, + ])) { // If so, call it ... $processorInstance->$method(); } diff --git a/CRM/Extension/System.php b/CRM/Extension/System.php index 0a521e77e4..6aeaa30bae 100644 --- a/CRM/Extension/System.php +++ b/CRM/Extension/System.php @@ -109,7 +109,8 @@ class CRM_Extension_System { if (!array_key_exists('domain_id', $parameters)) { $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; } @@ -243,7 +244,8 @@ class CRM_Extension_System { $this->downloader = new CRM_Extension_Downloader( $this->getManager(), $basedir, - CRM_Utils_File::tempdir() // WAS: $config->extensionsDir . DIRECTORY_SEPARATOR . 'tmp'; + // WAS: $config->extensionsDir . DIRECTORY_SEPARATOR . 'tmp'; + CRM_Utils_File::tempdir() ); } return $this->downloader; @@ -323,7 +325,8 @@ class CRM_Extension_System { switch ($extensionRow['status']) { case CRM_Extension_Manager::STATUS_UNINSTALLED: - $extensionRow['statusLabel'] = ''; // ts('Uninstalled'); + // ts('Uninstalled'); + $extensionRow['statusLabel'] = ''; break; case CRM_Extension_Manager::STATUS_DISABLED: @@ -331,7 +334,8 @@ class CRM_Extension_System { break; case CRM_Extension_Manager::STATUS_INSTALLED: - $extensionRow['statusLabel'] = ts('Enabled'); // ts('Installed'); + // ts('Installed'); + $extensionRow['statusLabel'] = ts('Enabled'); break; case CRM_Extension_Manager::STATUS_DISABLED_MISSING: @@ -339,7 +343,8 @@ class CRM_Extension_System { break; case CRM_Extension_Manager::STATUS_INSTALLED_MISSING: - $extensionRow['statusLabel'] = ts('Enabled (Missing)'); // ts('Installed'); + // ts('Installed'); + $extensionRow['statusLabel'] = ts('Enabled (Missing)'); break; default: diff --git a/CRM/Financial/BAO/ExportFormat.php b/CRM/Financial/BAO/ExportFormat.php index ac50f54cbd..1f46538369 100644 --- a/CRM/Financial/BAO/ExportFormat.php +++ b/CRM/Financial/BAO/ExportFormat.php @@ -91,7 +91,7 @@ abstract class CRM_Financial_BAO_ExportFormat { * * @param $exportDaos array with DAO's for queries to be exported. */ - public abstract function makeExport($exportDaos); + abstract public function makeExport($exportDaos); /** * @return string @@ -108,7 +108,7 @@ abstract class CRM_Financial_BAO_ExportFormat { * * @return string */ - public abstract function getFileExtension(); + abstract public function getFileExtension(); /** * @return object @@ -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, * but for CSV it doesn't make sense because php has built in csv output functions. */ + /** * @param $s * @param string $type @@ -162,7 +163,8 @@ abstract class CRM_Financial_BAO_ExportFormat { ob_clean(); flush(); 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(); } } diff --git a/CRM/Financial/BAO/ExportFormat/CSV.php b/CRM/Financial/BAO/ExportFormat/CSV.php index ab830e1839..c38c11ca9b 100644 --- a/CRM/Financial/BAO/ExportFormat/CSV.php +++ b/CRM/Financial/BAO/ExportFormat/CSV.php @@ -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. * * Possibly in the future this could be selected by the user. + * @var array */ public static $complementaryTables = [ 'ACCNT', diff --git a/CRM/Financial/BAO/ExportFormat/IIF.php b/CRM/Financial/BAO/ExportFormat/IIF.php index 920089c5b6..8ff0ef4b9b 100644 --- a/CRM/Financial/BAO/ExportFormat/IIF.php +++ b/CRM/Financial/BAO/ExportFormat/IIF.php @@ -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. * 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 * referenced in the journal entries that isn't defined anywhere. * * Possibly in the future this could be selected by the user. + * @var array */ public static $complementaryTables = [ 'ACCNT', diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php index 3b09c7cdd1..1d49d61931 100644 --- a/CRM/Financial/BAO/FinancialType.php +++ b/CRM/Financial/BAO/FinancialType.php @@ -34,12 +34,15 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { /** * 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 + * @var array */ - static $_statusACLFt = []; + public static $_statusACLFt = []; /** * Class constructor. diff --git a/CRM/Financial/BAO/Payment.php b/CRM/Financial/BAO/Payment.php index ed84d2538d..fbb3e58de8 100644 --- a/CRM/Financial/BAO/Payment.php +++ b/CRM/Financial/BAO/Payment.php @@ -205,6 +205,7 @@ class CRM_Financial_BAO_Payment { ]); return (int) $contribution['contact_id']; } + /** * @param array $entities * Related entities as an array keyed by the various entities. @@ -268,7 +269,7 @@ class CRM_Financial_BAO_Payment { 'refundAmount', 'totalPaid', 'paymentsComplete', - 'emailGreeting' + 'emailGreeting', ]; // 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 diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index 584d1b1068..fbf922c7c6 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -37,8 +37,9 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProcessor { /** * Static holder for the default payment processor + * @var object */ - static $_defaultPaymentProcessor = NULL; + public static $_defaultPaymentProcessor = NULL; /** * Create Payment Processor. diff --git a/CRM/Financial/BAO/PaymentProcessorType.php b/CRM/Financial/BAO/PaymentProcessorType.php index 89ca29f159..2a8f7ba042 100644 --- a/CRM/Financial/BAO/PaymentProcessorType.php +++ b/CRM/Financial/BAO/PaymentProcessorType.php @@ -34,8 +34,9 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr /** * Static holder for the default payment processor. + * @var object */ - static $_defaultPaymentProcessorType = NULL; + public static $_defaultPaymentProcessorType = NULL; /** * Class constructor. @@ -199,7 +200,7 @@ WHERE pp.payment_processor_type_id = ppt.id AND ppt.id = %1"; * * @return array */ - static private function getAllPaymentProcessorTypes($attr) { + private static function getAllPaymentProcessorTypes($attr) { $ppt = []; $dao = new CRM_Financial_DAO_PaymentProcessorType(); $dao->find(); diff --git a/CRM/Financial/Form/BatchTransaction.php b/CRM/Financial/Form/BatchTransaction.php index 0063079379..584ed6a338 100644 --- a/CRM/Financial/Form/BatchTransaction.php +++ b/CRM/Financial/Form/BatchTransaction.php @@ -35,18 +35,18 @@ * This class generates form components for Financial Type */ class CRM_Financial_Form_BatchTransaction extends CRM_Contribute_Form { - static $_links = NULL; - static $_entityID; + public static $_links = NULL; + public static $_entityID; /** * Batch status. - * @var + * @var int */ protected $_batchStatusId; /** * Batch status name. - * @string + * @var string */ protected $_batchStatus; diff --git a/CRM/Financial/Form/Export.php b/CRM/Financial/Form/Export.php index 47cb220617..966a179324 100644 --- a/CRM/Financial/Form/Export.php +++ b/CRM/Financial/Form/Export.php @@ -47,21 +47,25 @@ class CRM_Financial_Form_Export extends CRM_Core_Form { /** * Financial batch ids. + * @var array */ protected $_batchIds = []; /** * Export status id. + * @var int */ protected $_exportStatusId; /** * Export format. + * @var string */ protected $_exportFormat; /** * Download export File. + * @var bool */ protected $_downloadFile = TRUE; diff --git a/CRM/Financial/Form/FinancialAccount.php b/CRM/Financial/Form/FinancialAccount.php index d0627d6b2b..6b38724a81 100644 --- a/CRM/Financial/Form/FinancialAccount.php +++ b/CRM/Financial/Form/FinancialAccount.php @@ -43,7 +43,6 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form { */ protected $_isARFlag = FALSE; - /** * Set variables up before form is built. */ diff --git a/CRM/Financial/Form/FinancialTypeAccount.php b/CRM/Financial/Form/FinancialTypeAccount.php index 231d91dcde..e0940a738a 100644 --- a/CRM/Financial/Form/FinancialTypeAccount.php +++ b/CRM/Financial/Form/FinancialTypeAccount.php @@ -186,22 +186,21 @@ class CRM_Financial_Form_FinancialTypeAccount extends CRM_Contribute_Form { ); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'next', - 'name' => ts('Save and New'), - 'subName' => 'new', - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'next', + 'name' => ts('Save and New'), + 'subName' => 'new', + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); $this->addFormRule(['CRM_Financial_Form_FinancialTypeAccount', 'formRule'], $this); } diff --git a/CRM/Financial/Form/PaymentEdit.php b/CRM/Financial/Form/PaymentEdit.php index 245173ada7..105b98641c 100644 --- a/CRM/Financial/Form/PaymentEdit.php +++ b/CRM/Financial/Form/PaymentEdit.php @@ -59,6 +59,7 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form { public function getDefaultContext() { return 'create'; } + /** * Set variables up before form is built. */ diff --git a/CRM/Financial/Form/SalesTaxTrait.php b/CRM/Financial/Form/SalesTaxTrait.php index a3eeb282b2..bf0b89818e 100644 --- a/CRM/Financial/Form/SalesTaxTrait.php +++ b/CRM/Financial/Form/SalesTaxTrait.php @@ -30,7 +30,6 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2019 */ - trait CRM_Financial_Form_SalesTaxTrait { /** diff --git a/CRM/Financial/Page/Batch.php b/CRM/Financial/Page/Batch.php index 9074747cbb..36340646ab 100644 --- a/CRM/Financial/Page/Batch.php +++ b/CRM/Financial/Page/Batch.php @@ -41,7 +41,7 @@ class CRM_Financial_Page_Batch extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Get BAO Name. diff --git a/CRM/Financial/Page/BatchTransaction.php b/CRM/Financial/Page/BatchTransaction.php index d9e7c42fc0..23b6789c42 100644 --- a/CRM/Financial/Page/BatchTransaction.php +++ b/CRM/Financial/Page/BatchTransaction.php @@ -41,11 +41,11 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; - static $_entityID; + public static $_links = NULL; + public static $_entityID; - static $_columnHeader = NULL; - static $_returnvalues = NULL; + public static $_columnHeader = NULL; + public static $_returnvalues = NULL; /** * Get BAO Name. @@ -91,7 +91,8 @@ class CRM_Financial_Page_BatchTransaction extends CRM_Core_Page_Basic { */ public function run() { // get the requested action - $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); // default to 'browse' + // default to 'browse' + $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); // assign vars to templates $this->assign('action', $action); diff --git a/CRM/Financial/Page/FinancialAccount.php b/CRM/Financial/Page/FinancialAccount.php index b455f27b6b..74c38c429c 100644 --- a/CRM/Financial/Page/FinancialAccount.php +++ b/CRM/Financial/Page/FinancialAccount.php @@ -42,7 +42,7 @@ class CRM_Financial_Page_FinancialAccount extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Get BAO Name. diff --git a/CRM/Financial/Page/FinancialBatch.php b/CRM/Financial/Page/FinancialBatch.php index 2fdd43d00c..0c25a0a72b 100644 --- a/CRM/Financial/Page/FinancialBatch.php +++ b/CRM/Financial/Page/FinancialBatch.php @@ -41,7 +41,7 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Get BAO Name. @@ -92,7 +92,6 @@ class CRM_Financial_Page_FinancialBatch extends CRM_Core_Page_Basic { return CRM_Core_Page::run(); } - /** * Get name of edit form. * diff --git a/CRM/Financial/Page/FinancialType.php b/CRM/Financial/Page/FinancialType.php index 638bb412f6..6bb3b325ff 100644 --- a/CRM/Financial/Page/FinancialType.php +++ b/CRM/Financial/Page/FinancialType.php @@ -42,7 +42,7 @@ class CRM_Financial_Page_FinancialType extends CRM_Core_Page_Basic { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * Get BAO Name. diff --git a/CRM/Financial/Page/FinancialTypeAccount.php b/CRM/Financial/Page/FinancialTypeAccount.php index a0c17c3109..c4f019b664 100644 --- a/CRM/Financial/Page/FinancialTypeAccount.php +++ b/CRM/Financial/Page/FinancialTypeAccount.php @@ -40,7 +40,7 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { * * @var array */ - static $_links = NULL; + public static $_links = NULL; /** * The account id that we need to display for the browse screen. @@ -94,7 +94,8 @@ class CRM_Financial_Page_FinancialTypeAccount extends CRM_Core_Page { */ public function run() { // get the requested action - $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); // default to 'browse' + // default to 'browse' + $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); // assign vars to templates $this->assign('action', $action); -- 2.25.1