From 518fa0ee1556723e8e67e02a59e8e7f51ed76f6b Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 11 Apr 2019 07:36:06 +1000 Subject: [PATCH] (NFC) Update CRM/Core CRM/Custom CRM/Dedupe to match the new coder style --- CRM/Core/Action.php | 6 +- CRM/Core/BAO/Block.php | 3 +- CRM/Core/BAO/Cache.php | 3 +- CRM/Core/BAO/CustomGroup.php | 12 ++-- CRM/Core/BAO/CustomOption.php | 2 +- CRM/Core/BAO/CustomQuery.php | 4 +- CRM/Core/BAO/CustomValue.php | 1 - CRM/Core/BAO/Dashboard.php | 3 +- CRM/Core/BAO/Domain.php | 6 +- CRM/Core/BAO/File.php | 6 +- CRM/Core/BAO/FinancialTrxn.php | 2 + CRM/Core/BAO/Job.php | 2 +- CRM/Core/BAO/LabelFormat.php | 8 ++- CRM/Core/BAO/Location.php | 25 ++++---- CRM/Core/BAO/LocationType.php | 5 +- CRM/Core/BAO/Log.php | 2 +- CRM/Core/BAO/Mapping.php | 9 ++- CRM/Core/BAO/MessageTemplate.php | 12 ++-- CRM/Core/BAO/Navigation.php | 10 ++-- CRM/Core/BAO/Note.php | 2 +- CRM/Core/BAO/PaperSize.php | 8 ++- CRM/Core/BAO/PdfFormat.php | 6 +- CRM/Core/BAO/PreferencesDate.php | 3 +- CRM/Core/BAO/PrevNextCache.php | 6 +- CRM/Core/BAO/RecurringEntity.php | 48 ++++++++------- CRM/Core/BAO/Tag.php | 22 +++---- CRM/Core/BAO/UFField.php | 2 +- CRM/Core/BAO/UFGroup.php | 42 ++++++------- CRM/Core/BAO/UFMatch.php | 1 - CRM/Core/BAO/WordReplacement.php | 1 - CRM/Core/Block.php | 3 +- CRM/Core/CodeGen/Config.php | 1 + CRM/Core/CodeGen/I18n.php | 1 + CRM/Core/CodeGen/Main.php | 32 ++++++---- CRM/Core/CodeGen/Specification.php | 1 + CRM/Core/CodeGen/Test.php | 1 + CRM/Core/CodeGen/Util/File.php | 1 + CRM/Core/CodeGen/Util/Xml.php | 1 + CRM/Core/CommunityMessages.php | 6 +- CRM/Core/Component.php | 11 ++-- CRM/Core/Config.php | 16 ++--- CRM/Core/Config/MagicMerge.php | 15 +++-- CRM/Core/Config/Runtime.php | 15 +++-- CRM/Core/Controller.php | 8 +-- CRM/Core/DAO.php | 28 +++++---- CRM/Core/Error.php | 10 +++- CRM/Core/Form.php | 47 ++++++++------- CRM/Core/Form/Date.php | 1 - CRM/Core/Form/EntityFormTrait.php | 38 ++++++------ CRM/Core/Form/RecurringEntity.php | 28 +++++---- CRM/Core/Form/Renderer.php | 8 +-- CRM/Core/Form/Search.php | 2 + CRM/Core/Form/ShortCode.php | 3 +- CRM/Core/Form/Task.php | 25 ++++---- CRM/Core/Form/Task/Batch.php | 15 +++-- CRM/Core/Form/Task/PDFLetterCommon.php | 18 +++--- CRM/Core/Form/Task/PickProfile.php | 4 +- CRM/Core/I18n.php | 8 ++- CRM/Core/I18n/Form.php | 1 + CRM/Core/I18n/NativeGettext.php | 1 + CRM/Core/I18n/SchemaStructure.php | 14 ++--- CRM/Core/I18n/SchemaStructure_4_2_alpha1.php | 1 + CRM/Core/I18n/SchemaStructure_4_3_1.php | 1 + CRM/Core/I18n/SchemaStructure_4_5_alpha1.php | 1 + CRM/Core/IDS.php | 1 + CRM/Core/InnoDBIndexer.php | 3 +- CRM/Core/Invoke.php | 16 ++--- CRM/Core/JobManager.php | 9 ++- CRM/Core/Key.php | 4 +- CRM/Core/LegacyErrorHandler.php | 1 + CRM/Core/Lock.php | 9 ++- CRM/Core/ManagedEntities.php | 3 +- CRM/Core/Menu.php | 36 ++++++----- CRM/Core/Module.php | 3 +- CRM/Core/OptionGroup.php | 21 +++---- CRM/Core/OptionValue.php | 6 +- CRM/Core/Page/AJAX/Attachment.php | 3 +- CRM/Core/Page/AJAX/Location.php | 17 +++--- CRM/Core/Page/File.php | 9 ++- CRM/Core/Page/Inline/Help.php | 1 + CRM/Core/Payment.php | 17 +++--- CRM/Core/Payment/AuthorizeNet.php | 8 ++- CRM/Core/Payment/AuthorizeNetIPN.php | 2 +- CRM/Core/Payment/BaseIPN.php | 30 +++++----- CRM/Core/Payment/FirstData.php | 1 + CRM/Core/Payment/Form.php | 5 +- CRM/Core/Payment/PayJunction.php | 2 +- CRM/Core/Payment/PayPalIPN.php | 5 +- CRM/Core/Payment/PayPalImpl.php | 2 +- CRM/Core/Payment/PayPalProIPN.php | 19 +++--- CRM/Core/Payment/PayflowPro.php | 2 +- CRM/Core/Payment/PaymentExpressIPN.php | 4 +- CRM/Core/Payment/ProcessorForm.php | 1 + CRM/Core/Payment/eWAY.php | 1 + CRM/Core/Permission.php | 3 +- CRM/Core/Permission/Backdrop.php | 39 ++++++------ CRM/Core/Permission/Base.php | 5 +- CRM/Core/Permission/Drupal.php | 1 - CRM/Core/Permission/Drupal8.php | 1 + CRM/Core/Permission/Joomla.php | 15 ++--- CRM/Core/Permission/Temp.php | 2 +- CRM/Core/Permission/UnitTests.php | 5 +- CRM/Core/Permission/WordPress.php | 1 + CRM/Core/PrevNextCache/Sql.php | 4 +- CRM/Core/PseudoConstant.php | 12 ++-- CRM/Core/QuickForm/Action/Display.php | 4 +- CRM/Core/QuickForm/Action/Upload.php | 6 +- CRM/Core/QuickForm/GroupMultiSelect.php | 1 + CRM/Core/QuickForm/NestedAdvMultiSelect.php | 1 + CRM/Core/Reference/Interface.php | 1 + CRM/Core/Region.php | 6 +- CRM/Core/Resources.php | 59 ++++++++++--------- CRM/Core/Resources/Strings.php | 3 +- CRM/Core/ScheduledJob.php | 8 +-- CRM/Core/SelectValues.php | 3 +- CRM/Core/Selector/Controller.php | 1 + CRM/Core/Session.php | 3 +- CRM/Core/ShowHideBlocks.php | 3 +- CRM/Core/Smarty/Permissions.php | 1 + CRM/Core/Smarty/plugins/function.crmAPI.php | 1 - CRM/Core/Smarty/plugins/function.crmKey.php | 3 +- .../function.simpleActivityContacts.php | 10 ++-- .../plugins/prefilter.resetExtScope.php | 3 +- CRM/Core/Smarty/resources/String.php | 11 ++-- CRM/Core/TableHierarchy.php | 2 +- CRM/Core/Task.php | 2 +- CRM/Core/TemporaryErrorScope.php | 2 +- CRM/Core/Transaction.php | 11 ++-- CRM/Custom/Form/ChangeFieldType.php | 40 ++++++------- CRM/Custom/Form/DeleteField.php | 21 ++++--- CRM/Custom/Form/DeleteGroup.php | 21 ++++--- CRM/Custom/Form/Field.php | 38 ++++++------ CRM/Custom/Form/MoveField.php | 21 ++++--- CRM/Custom/Form/Option.php | 53 ++++++++--------- CRM/Custom/Form/Preview.php | 13 ++-- CRM/Custom/Import/Controller.php | 1 + CRM/Custom/Import/Form/Summary.php | 1 + CRM/Custom/Import/Parser.php | 30 +++++----- CRM/Custom/Import/Parser/Api.php | 8 +-- CRM/Dedupe/BAO/QueryBuilder.php | 1 + .../BAO/QueryBuilder/IndividualGeneral.php | 1 + CRM/Dedupe/BAO/Rule.php | 8 ++- CRM/Dedupe/BAO/RuleGroup.php | 10 ++-- CRM/Dedupe/Finder.php | 2 +- CRM/Dedupe/Merger.php | 27 ++++----- 145 files changed, 752 insertions(+), 646 deletions(-) diff --git a/CRM/Core/Action.php b/CRM/Core/Action.php index 4e5e811ea5..638976ea32 100644 --- a/CRM/Core/Action.php +++ b/CRM/Core/Action.php @@ -74,10 +74,10 @@ class CRM_Core_Action { * bit manipulation operations so we can perform multiple * actions on the same object if needed * - * @var array $_names type of variable name to action constant + * @var array * */ - static $_names = [ + public static $_names = [ 'add' => self::ADD, 'update' => self::UPDATE, 'view' => self::VIEW, @@ -102,7 +102,7 @@ class CRM_Core_Action { * * @var array */ - static $_description; + public static $_description; /** * Called by the request object to translate a string into a mask. diff --git a/CRM/Core/BAO/Block.php b/CRM/Core/BAO/Block.php index 780d00acda..a9ffa34e2f 100644 --- a/CRM/Core/BAO/Block.php +++ b/CRM/Core/BAO/Block.php @@ -36,8 +36,9 @@ class CRM_Core_BAO_Block { /** * Fields that are required for a valid block. + * @var array */ - static $requiredBlockFields = [ + public static $requiredBlockFields = [ 'email' => ['email'], 'phone' => ['phone'], 'im' => ['name'], diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php index 3347f978d8..13d59a848b 100644 --- a/CRM/Core/BAO/Cache.php +++ b/CRM/Core/BAO/Cache.php @@ -51,7 +51,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { /** * @var array ($cacheKey => $cacheValue) */ - static $_cache = NULL; + public static $_cache = NULL; /** * Retrieve an item from the DB cache. @@ -359,6 +359,7 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @param bool $session * @param bool $table * @param bool $prevNext + * @param bool $expired */ public static function cleanup($session = FALSE, $table = FALSE, $prevNext = FALSE, $expired = FALSE) { // clean up the session cache every $cacheCleanUpNumber probabilistically diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 01e65fc4ce..d20a3188d9 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -716,7 +716,7 @@ ORDER BY civicrm_custom_group.weight, * @return string * SQL condition. */ - static private function whereListHas($column, $value, $delimiter = CRM_Core_DAO::VALUE_SEPARATOR) { + private static function whereListHas($column, $value, $delimiter = CRM_Core_DAO::VALUE_SEPARATOR) { // ? $bareValue = trim($value, $delimiter); $escapedValue = CRM_Utils_Type::escape("%{$delimiter}{$bareValue}{$delimiter}%", 'String', FALSE); @@ -736,7 +736,7 @@ ORDER BY civicrm_custom_group.weight, * @return bool * does this entity have data in this custom table */ - static public function customGroupDataExistsForEntity($entityID, $table, $getCount = FALSE) { + public static function customGroupDataExistsForEntity($entityID, $table, $getCount = FALSE) { $query = " SELECT count(id) FROM $table @@ -765,7 +765,7 @@ ORDER BY civicrm_custom_group.weight, * @param array $singleFieldTablesWithEntityData * Array of tables in which this entity has data. */ - static public function buildEntityTreeSingleFields(&$groupTree, $entityID, $entitySingleSelectClauses, $singleFieldTablesWithEntityData) { + public static function buildEntityTreeSingleFields(&$groupTree, $entityID, $entitySingleSelectClauses, $singleFieldTablesWithEntityData) { $select = implode(', ', $entitySingleSelectClauses); $fromSQL = " (SELECT $entityID as entity_id ) as first "; foreach ($singleFieldTablesWithEntityData as $table) { @@ -796,7 +796,7 @@ ORDER BY civicrm_custom_group.weight, * @param string|int $singleRecord * holds 'new' or id if view/edit/copy form for a single record is being loaded. */ - static public function buildEntityTreeMultipleFields(&$groupTree, $entityID, $entityMultipleSelectClauses, $multipleFieldTablesWithEntityData, $singleRecord = NULL) { + public static function buildEntityTreeMultipleFields(&$groupTree, $entityID, $entityMultipleSelectClauses, $multipleFieldTablesWithEntityData, $singleRecord = NULL) { foreach ($entityMultipleSelectClauses as $table => $selectClauses) { $select = implode(',', $selectClauses); $query = " @@ -827,7 +827,7 @@ ORDER BY civicrm_custom_group.weight, * @param string|int $singleRecord * holds 'new' OR id if view/edit/copy form for a single record is being loaded. */ - static public function buildTreeEntityDataFromQuery(&$groupTree, $query, $includedTables, $singleRecord = NULL) { + public static function buildTreeEntityDataFromQuery(&$groupTree, $query, $includedTables, $singleRecord = NULL) { $dao = CRM_Core_DAO::executeQuery($query); while ($dao->fetch()) { foreach ($groupTree as $groupID => $group) { @@ -864,7 +864,7 @@ ORDER BY civicrm_custom_group.weight, * @param string|int $singleRecord * holds 'new' or id if loading view/edit/copy for a single record. */ - static public function buildCustomFieldData($dao, &$groupTree, $table, $groupID, $fieldID, $singleRecord = NULL) { + public static function buildCustomFieldData($dao, &$groupTree, $table, $groupID, $fieldID, $singleRecord = NULL) { $column = $groupTree[$groupID]['fields'][$fieldID]['column_name']; $idName = "{$table}_id"; $fieldName = "{$table}_{$column}"; diff --git a/CRM/Core/BAO/CustomOption.php b/CRM/Core/BAO/CustomOption.php index f667ba4d1f..9fa273922b 100644 --- a/CRM/Core/BAO/CustomOption.php +++ b/CRM/Core/BAO/CustomOption.php @@ -102,7 +102,7 @@ class CRM_Core_BAO_CustomOption { * -rp = rowcount * -page= offset */ - static public function getOptionListSelector(&$params) { + public static function getOptionListSelector(&$params) { $options = []; $field = CRM_Core_BAO_CustomField::getFieldObject($params['fid']); diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php index f3efb735d3..790487e438 100644 --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@ -79,10 +79,10 @@ class CRM_Core_BAO_CustomQuery { public $_qill; /** - * @deprecated * No longer needed due to CRM-17646 refactoring, but still used in some places * * @var array + * @deprecated */ public $_options; @@ -107,7 +107,7 @@ class CRM_Core_BAO_CustomQuery { * * @var array */ - static $extendsMap = [ + public static $extendsMap = [ 'Contact' => 'civicrm_contact', 'Individual' => 'civicrm_contact', 'Household' => 'civicrm_contact', diff --git a/CRM/Core/BAO/CustomValue.php b/CRM/Core/BAO/CustomValue.php index 305567fcbe..7df55cc393 100644 --- a/CRM/Core/BAO/CustomValue.php +++ b/CRM/Core/BAO/CustomValue.php @@ -157,7 +157,6 @@ class CRM_Core_BAO_CustomValue extends CRM_Core_DAO { } } - /** * @param array $formValues * @return null diff --git a/CRM/Core/BAO/Dashboard.php b/CRM/Core/BAO/Dashboard.php index 091348624b..8b61cf0c0d 100644 --- a/CRM/Core/BAO/Dashboard.php +++ b/CRM/Core/BAO/Dashboard.php @@ -35,6 +35,7 @@ * Class contains Contact dashboard related functions. */ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { + /** * Add Dashboard. * @@ -175,7 +176,7 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { * the default dashlets. * * @return array - * Array of dashboard_id's + * Array of dashboard_id's * @throws \CiviCRM_API3_Exception */ public static function initializeDashlets() { diff --git a/CRM/Core/BAO/Domain.php b/CRM/Core/BAO/Domain.php index bfbb06fc64..d4ccd6c9d1 100644 --- a/CRM/Core/BAO/Domain.php +++ b/CRM/Core/BAO/Domain.php @@ -38,11 +38,13 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { /** * Cache for the current domain object. + * @var object */ - static $_domain = NULL; + public static $_domain = NULL; /** * Cache for a domain's location array + * @var array */ private $_location = NULL; @@ -164,7 +166,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { /** * @param bool $skipFatal - * + * @param bool $returnString * @return array * name & email for domain * @throws Exception diff --git a/CRM/Core/BAO/File.php b/CRM/Core/BAO/File.php index 8845687292..c9a1265d67 100644 --- a/CRM/Core/BAO/File.php +++ b/CRM/Core/BAO/File.php @@ -38,7 +38,7 @@ */ class CRM_Core_BAO_File extends CRM_Core_DAO_File { - static $_signableFields = ['entityTable', 'entityID', 'fileID']; + public static $_signableFields = ['entityTable', 'entityID', 'fileID']; /** * Takes an associative array and creates a File object. @@ -95,7 +95,6 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File { return [NULL, NULL]; } - /** * @param $data * @param int $fileTypeID @@ -695,7 +694,6 @@ AND CEF.entity_id = %2"; self::deleteEntityFile($params['entityTable'], $params['entityID'], NULL, $params['fileID']); } - /** * Display paper icon for a file attachment -- CRM-13624 * @@ -772,6 +770,8 @@ AND CEF.entity_id = %2"; * * @param int $entityId entity id the file is attached to * @param int $fileId file ID + * @param int $genTs + * @param int $life * @return string */ public static function generateFileHash($entityId = NULL, $fileId = NULL, $genTs = NULL, $life = NULL) { diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index ee5c3267c7..6b3d453369 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -36,6 +36,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { * * @return \CRM_Financial_DAO_FinancialTrxn */ + /** */ public function __construct() { @@ -139,6 +140,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { * @param bool $newTrxn * @param string $whereClause * Additional where parameters + * @param int $fromAccountID * * @return array * array of category id's the contact belongs to. diff --git a/CRM/Core/BAO/Job.php b/CRM/Core/BAO/Job.php index 0b9a32272c..0509a0af47 100644 --- a/CRM/Core/BAO/Job.php +++ b/CRM/Core/BAO/Job.php @@ -149,7 +149,7 @@ class CRM_Core_BAO_Job extends CRM_Core_DAO_Job { * Make a copy of a Job. * * @param int $id The job id to copy. - * + * @param array $params * @return CRM_Core_DAO */ public static function copy($id, $params = []) { diff --git a/CRM/Core/BAO/LabelFormat.php b/CRM/Core/BAO/LabelFormat.php index 96c4ffbf62..3ff7966611 100644 --- a/CRM/Core/BAO/LabelFormat.php +++ b/CRM/Core/BAO/LabelFormat.php @@ -39,11 +39,13 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { /** * Static holder for the Label Formats Option Group ID. + * @var int */ private static $_gid = NULL; /** * Label Format fields stored in the 'value' field of the Option Value table. + * @var array */ private static $optionValueFields = [ 'paper-size' => [ @@ -258,7 +260,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { /** * Add ordering fields to Label Format list. * - * @param array (reference) $list List of Label Formats + * @param array $list List of Label Formats * @param string $returnURL * URL of page calling this function. * @@ -382,7 +384,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { * * @param string $field * Name of a label format field. - * @param array (reference) $values associative array of name/value pairs containing + * @param array $values associative array of name/value pairs containing * label format field selections * * @param null $default @@ -458,7 +460,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue { /** * Save the Label Format in the DB. * - * @param array (reference) $values associative array of name/value pairs + * @param array $values associative array of name/value pairs * @param int $id * Id of the database record (null = new record). * @param string $groupName diff --git a/CRM/Core/BAO/Location.php b/CRM/Core/BAO/Location.php index 0cd00b5763..72899e0075 100644 --- a/CRM/Core/BAO/Location.php +++ b/CRM/Core/BAO/Location.php @@ -38,8 +38,9 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO { /** * Location block element array. + * @var array */ - static $blocks = ['phone', 'email', 'im', 'openid', 'address']; + public static $blocks = ['phone', 'email', 'im', 'openid', 'address']; /** * Create various elements of location block. @@ -109,11 +110,11 @@ class CRM_Core_BAO_Location extends CRM_Core_DAO { } foreach ([ - 'phone', - 'email', - 'im', - 'address', - ] as $loc) { + 'phone', + 'email', + 'im', + 'address', + ] as $loc) { $locBlock["{$loc}_id"] = !empty($location["$loc"][0]) ? $location["$loc"][0]->id : NULL; $locBlock["{$loc}_2_id"] = !empty($location["$loc"][1]) ? $location["$loc"][1]->id : NULL; } @@ -367,12 +368,12 @@ WHERE e.id = %1"; $nonPrimaryBlockIds = CRM_Contact_BAO_Contact::getLocBlockIds($contactId, ['is_primary' => 0]); foreach ([ - 'Email', - 'IM', - 'Phone', - 'Address', - 'OpenID', - ] as $block) { + 'Email', + 'IM', + 'Phone', + 'Address', + 'OpenID', + ] as $block) { $name = strtolower($block); if (array_key_exists($name, $primaryLocBlockIds) && !CRM_Utils_System::isNull($primaryLocBlockIds[$name]) diff --git a/CRM/Core/BAO/LocationType.php b/CRM/Core/BAO/LocationType.php index 269284ccca..7f4cdab2df 100644 --- a/CRM/Core/BAO/LocationType.php +++ b/CRM/Core/BAO/LocationType.php @@ -36,9 +36,10 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { /** * Static holder for the default LT. + * @var int */ - static $_defaultLocationType = NULL; - static $_billingLocationType = NULL; + public static $_defaultLocationType = NULL; + public static $_billingLocationType = NULL; /** * Class constructor. diff --git a/CRM/Core/BAO/Log.php b/CRM/Core/BAO/Log.php index a22a4c1eef..eb75c83708 100644 --- a/CRM/Core/BAO/Log.php +++ b/CRM/Core/BAO/Log.php @@ -35,7 +35,7 @@ * BAO object for crm_log table */ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log { - static $_processed = NULL; + public static $_processed = NULL; /** * @param int $id diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index ccf17e6b79..3a9e29f5e7 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -396,10 +396,10 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { //we need to unset groups, tags, notes for component export if ($exportMode != CRM_Export_Form_Select::CONTACT_EXPORT) { foreach ([ - 'groups', - 'tags', - 'notes', - ] as $value) { + 'groups', + 'tags', + 'notes', + ] as $value) { unset($fields['Individual'][$value]); unset($fields['Household'][$value]); unset($fields['Organization'][$value]); @@ -983,7 +983,6 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { return $groupTitle; } - /** * Function returns all Custom group Names. * diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index 31a6f7369f..6687dd0ee4 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -272,9 +272,9 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { $smarty = CRM_Core_Smarty::singleton(); foreach ([ - 'text', - 'html', - ] as $elem) { + 'text', + 'html', + ] as $elem) { $$elem = $smarty->fetch("string:{$$elem}"); } @@ -427,9 +427,9 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { } else { CRM_Core_Error::fatal(ts('No such message template: option group %1, option value %2.', [ - 1 => $params['groupName'], - 2 => $params['valueName'], - ])); + 1 => $params['groupName'], + 2 => $params['valueName'], + ])); } } diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index 56bd323332..90cc56fb1c 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -792,7 +792,7 @@ FROM civicrm_navigation WHERE domain_id = $domainID"; * * @return bool|\CRM_Core_DAO */ - static public function createOrUpdateTopLevelReportsNavItem($domain_id) { + public static function createOrUpdateTopLevelReportsNavItem($domain_id) { $id = NULL; $dao = new CRM_Core_BAO_Navigation(); @@ -892,7 +892,7 @@ FROM civicrm_navigation WHERE domain_id = $domainID"; * If True then do not match with a url that has a different parent * (This is because for top level items there is a risk of 'stealing' rows that normally * live under 'Contact' and intentionally duplicate the report examples.) - * + * @param bool $useWildcard * @return \CRM_Core_DAO_Navigation */ protected static function createOrUpdateReportNavItem($name, $url, $url_params, $parent_id, $permission, @@ -996,7 +996,7 @@ FROM civicrm_navigation WHERE domain_id = $domainID"; 'name' => 'CiviCRM Home', 'url' => 'civicrm/dashboard?reset=1', 'weight' => 1, - ] + ], ], [ 'attributes' => [ @@ -1004,7 +1004,7 @@ FROM civicrm_navigation WHERE domain_id = $domainID"; 'name' => 'Hide Menu', 'url' => '#hidemenu', 'weight' => 2, - ] + ], ], [ 'attributes' => [ @@ -1012,7 +1012,7 @@ FROM civicrm_navigation WHERE domain_id = $domainID"; 'name' => 'Log out', 'url' => 'civicrm/logout?reset=1', 'weight' => 3, - ] + ], ], ]; return; diff --git a/CRM/Core/BAO/Note.php b/CRM/Core/BAO/Note.php index 1193b72d76..d30ae5bfaa 100644 --- a/CRM/Core/BAO/Note.php +++ b/CRM/Core/BAO/Note.php @@ -133,7 +133,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note { * (reference) an assoc array of name/value pairs. * @param array $ids * (deprecated) associated array with note id - preferably set $params['id']. - * @return null|object $note + * @return null|object * $note CRM_Core_BAO_Note object * @throws \CRM_Exception */ diff --git a/CRM/Core/BAO/PaperSize.php b/CRM/Core/BAO/PaperSize.php index 59664fff03..500dfcb98d 100644 --- a/CRM/Core/BAO/PaperSize.php +++ b/CRM/Core/BAO/PaperSize.php @@ -39,11 +39,13 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Static holder for the Paper Size Option Group ID. + * @var int */ private static $_gid = NULL; /** * Paper Size fields stored in the 'value' field of the Option Value table. + * @var array */ private static $optionValueFields = [ 'metric' => [ @@ -84,7 +86,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Add ordering fields to Paper Size list. * - * @param array (reference) $list List of Paper Sizes + * @param array $list List of Paper Sizes * @param string $returnURL * URL of page calling this function. * @@ -196,7 +198,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { * * @param string $field * Name of a Paper Size field. - * @param array (reference) $values associative array of name/value pairs containing + * @param array $values associative array of name/value pairs containing * Paper Size field selections * * @param null $default @@ -263,7 +265,7 @@ class CRM_Core_BAO_PaperSize extends CRM_Core_DAO_OptionValue { /** * Save the Paper Size in the DB. * - * @param array (reference) $values associative array of name/value pairs + * @param array $values associative array of name/value pairs * @param int $id * Id of the database record (null = new record). */ diff --git a/CRM/Core/BAO/PdfFormat.php b/CRM/Core/BAO/PdfFormat.php index 21bd66deee..3a964f8cb9 100644 --- a/CRM/Core/BAO/PdfFormat.php +++ b/CRM/Core/BAO/PdfFormat.php @@ -39,11 +39,13 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { /** * Static holder for the PDF Page Formats Option Group ID. + * @var int */ private static $_gid = NULL; /** * PDF Page Format fields stored in the 'value' field of the Option Value table. + * @var array */ private static $optionValueFields = [ 'paper_size' => [ @@ -139,7 +141,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { /** * Add ordering fields to Page Format list. * - * @param array (reference) $list List of PDF Page Formats + * @param array $list List of PDF Page Formats * @param string $returnURL * URL of page calling this function. */ @@ -253,7 +255,7 @@ class CRM_Core_BAO_PdfFormat extends CRM_Core_DAO_OptionValue { * * @param string $field * Name of a PDF Page Format field. - * @param array (reference) $values associative array of name/value pairs containing + * @param array $values associative array of name/value pairs containing * PDF Page Format field selections * * @param null $default diff --git a/CRM/Core/BAO/PreferencesDate.php b/CRM/Core/BAO/PreferencesDate.php index fdf0fc467a..80f963badb 100644 --- a/CRM/Core/BAO/PreferencesDate.php +++ b/CRM/Core/BAO/PreferencesDate.php @@ -34,8 +34,9 @@ class CRM_Core_BAO_PreferencesDate extends CRM_Core_DAO_PreferencesDate { /** * Static holder for the default LT. + * @var string */ - static $_defaultPreferencesDate = NULL; + public static $_defaultPreferencesDate = NULL; /** * Class constructor. diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index 8d5fd872f7..bca6a1824b 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -157,7 +157,8 @@ WHERE cacheKey = %3 AND if (isset($cacheKey)) { $sql .= " AND cacheKey LIKE %4"; - $params[4] = ["{$cacheKey}%", 'String']; // used % to address any row with conflict-cacheKey e.g "merge Individual_8_0_conflicts" + // used % to address any row with conflict-cacheKey e.g "merge Individual_8_0_conflicts" + $params[4] = ["{$cacheKey}%", 'String']; } CRM_Core_DAO::executeQuery($sql, $params); @@ -288,7 +289,7 @@ FROM civicrm_prevnext_cache pn if (!empty($select)) { $extraData = []; foreach ($select as $sfield) { - $extraData[$sfield] = $dao->$sfield; + $extraData[$sfield] = $dao->$sfield; } $main[$count] = [ 'prevnext_id' => $dao->id, @@ -438,7 +439,6 @@ AND c.created_date < date_sub( NOW( ), INTERVAL %2 day ) CRM_Core_DAO::executeQuery($sql, $params); } - /** * Get the selections. * diff --git a/CRM/Core/BAO/RecurringEntity.php b/CRM/Core/BAO/RecurringEntity.php index fcc5b4a5e8..95ef8907ec 100644 --- a/CRM/Core/BAO/RecurringEntity.php +++ b/CRM/Core/BAO/RecurringEntity.php @@ -59,7 +59,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { public static $status = NULL; - static $_recurringEntityHelper + public static $_recurringEntityHelper = [ 'civicrm_event' => [ 'helper_class' => 'CRM_Event_DAO_Event', @@ -73,7 +73,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { ], ]; - static $_dateColumns + public static $_dateColumns = [ 'civicrm_event' => [ 'dateColumns' => ['start_date'], @@ -85,7 +85,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { ], ]; - static $_tableDAOMapper + public static $_tableDAOMapper = [ 'civicrm_event' => 'CRM_Event_DAO_Event', 'civicrm_price_set_entity' => 'CRM_Price_DAO_PriceSetEntity', @@ -96,7 +96,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { 'civicrm_activity_contact' => 'CRM_Activity_DAO_ActivityContact', ]; - static $_updateSkipFields + public static $_updateSkipFields = [ 'civicrm_event' => ['start_date', 'end_date'], 'civicrm_tell_friend' => ['entity_id'], @@ -104,7 +104,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { 'civicrm_activity' => ['activity_date_time'], ]; - static $_linkedEntitiesInfo + public static $_linkedEntitiesInfo = [ 'civicrm_tell_friend' => [ 'entity_id_col' => 'entity_id', @@ -418,7 +418,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @return array * an array of child ids */ - static public function getEntitiesForParent($parentId, $entityTable, $includeParent = TRUE, $mode = 3, $initiatorId = NULL) { + public static function getEntitiesForParent($parentId, $entityTable, $includeParent = TRUE, $mode = 3, $initiatorId = NULL) { $entities = []; if (empty($parentId) || empty($entityTable)) { return $entities; @@ -454,7 +454,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { $recurringEntityID = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_recurring_entity WHERE entity_id = %3 AND entity_table = %2", $queryParams); if ($recurringEntityID) { $query .= $includeParent ? " AND id >= %4" : " AND id > %4"; - $query .= " ORDER BY id ASC"; // FIXME: change to order by dates + // FIXME: change to order by dates + $query .= " ORDER BY id ASC"; $queryParams[4] = [$recurringEntityID, 'Integer']; } else { @@ -488,7 +489,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @return array * array of connected ids */ - static public function getEntitiesFor($entityId, $entityTable, $includeParent = TRUE, $mode = 3) { + public static function getEntitiesFor($entityId, $entityTable, $includeParent = TRUE, $mode = 3) { $parentId = self::getParentFor($entityId, $entityTable); if ($parentId) { return self::getEntitiesForParent($parentId, $entityTable, $includeParent, $mode, $entityId); @@ -510,7 +511,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @return int * unsigned $parentId Parent ID */ - static public function getParentFor($entityId, $entityTable, $includeParent = TRUE) { + public static function getParentFor($entityId, $entityTable, $includeParent = TRUE) { if (empty($entityId) || empty($entityTable)) { return NULL; } @@ -539,7 +540,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @param $entityTable * @return array|null */ - static public function getPositionAndCount($entityId, $entityTable) { + public static function getPositionAndCount($entityId, $entityTable) { $position = $count = 0; $query = " @@ -581,7 +582,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return object */ - static public function copyCreateEntity($entityTable, $fromCriteria, $newParams, $createRecurringEntity = TRUE) { + public static function copyCreateEntity($entityTable, $fromCriteria, $newParams, $createRecurringEntity = TRUE) { $daoName = self::$_tableDAOMapper[$entityTable]; if (!$daoName) { CRM_Core_Error::fatal("DAO Mapper missing for $entityTable."); @@ -608,7 +609,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @param object $event * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just updated. */ - static public function triggerUpdate($event) { + public static function triggerUpdate($event) { // if DB version is earlier than 4.6 skip any processing static $currentVer = NULL; if (!$currentVer) { @@ -676,7 +677,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @param object $event * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just inserted. */ - static public function triggerInsert($event) { + public static function triggerInsert($event) { $obj =& $event->object; if (!array_key_exists($obj->__table, self::$_linkedEntitiesInfo)) { return; @@ -783,7 +784,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @param object $event * An object of /Civi/Core/DAO/Event/PostUpdate containing dao object that was just deleted. */ - static public function triggerDelete($event) { + public static function triggerDelete($event) { $obj =& $event->object; // if DB version is earlier than 4.6 skip any processing @@ -828,7 +829,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @return bool|\CRM_Core_DAO_RecurringEntity * @throws \Exception */ - static public function delEntity($entityId, $entityTable, $isDelLinkedEntities = FALSE) { + public static function delEntity($entityId, $entityTable, $isDelLinkedEntities = FALSE) { if (empty($entityId) || empty($entityTable)) { return FALSE; } @@ -947,7 +948,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * * @return object */ - static public function getScheduleReminderDetailsById($scheduleReminderId) { + public static function getScheduleReminderDetailsById($scheduleReminderId) { $query = "SELECT * FROM civicrm_action_schedule WHERE 1"; if ($scheduleReminderId) { @@ -1091,7 +1092,6 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { return $r; } - /** * This function gets time difference between the two datetime object. * @@ -1104,7 +1104,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @return object * DateTime object which contain time difference */ - static public function getInterval($startDate, $endDate) { + public static function getInterval($startDate, $endDate) { if ($startDate && $endDate) { $startDate = new DateTime($startDate); $endDate = new DateTime($endDate); @@ -1222,10 +1222,12 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { $seriesEventRecords = CRM_Core_BAO_RecurringEntity::getEntitiesFor($entityId, $entityTable); foreach ($seriesEventRecords as $event) { //Step-2: Save price set in other series events - if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) {//Remove existing priceset + //Remove existing priceset + if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) { CRM_Core_BAO_Discount::del($event['id'], $event['table']); } - CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet); //Add new price set + //Add new price set + CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet); } } @@ -1235,10 +1237,12 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { foreach ($seriesEventRecords as $event) { //Step-2: Save price set in other series events if ($entityId < $event["id"]) { - if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) {//Remove existing priceset + //Remove existing priceset + if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) { CRM_Core_BAO_Discount::del($event['id'], $event['table']); } - CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet); //Add new price set + //Add new price set + CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet); } } } diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index b54aec9df1..ef83365931 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -506,11 +506,11 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { $query = "SELECT name, id FROM civicrm_tag WHERE is_tagset=1 AND parent_id IS NULL and used_for LIKE %1"; $dao = CRM_Core_DAO::executeQuery($query, [ - 1 => [ - '%' . $entityTable . '%', - 'String', - ], - ], TRUE, NULL, FALSE, FALSE); + 1 => [ + '%' . $entityTable . '%', + 'String', + ], + ], TRUE, NULL, FALSE, FALSE); while ($dao->fetch()) { $tagSets[$dao->id] = $dao->name; } @@ -553,7 +553,7 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { * * @param string $searchString * - * @return array $childTagIDs + * @return array * associated array of child tags in Array('Parent Tag ID' => Array('Child Tag 1', ...)) format */ public static function getChildTags($searchString = NULL) { @@ -566,11 +566,11 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { // only fetch those tags which has child tags $dao = CRM_Utils_SQL_Select::from('civicrm_tag parent') - ->join('child', 'INNER JOIN civicrm_tag child ON child.parent_id = parent.id ') - ->select('parent.id as parent_id, GROUP_CONCAT(child.id) as child_id') - ->where($whereClauses) - ->groupBy('parent.id') - ->execute(); + ->join('child', 'INNER JOIN civicrm_tag child ON child.parent_id = parent.id ') + ->select('parent.id as parent_id, GROUP_CONCAT(child.id) as child_id') + ->where($whereClauses) + ->groupBy('parent.id') + ->execute(); while ($dao->fetch()) { $childTagIDs[$dao->parent_id] = (array) explode(',', $dao->child_id); $parentID = $dao->parent_id; diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index 37ee29e17a..dba79c97c8 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -38,6 +38,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { /** * Batch entry fields. + * @var array */ private static $_contriBatchEntryFields = NULL; private static $_memberBatchEntryFields = NULL; @@ -135,7 +136,6 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { return $ufField; } - /** * Fetch object based on array of properties. * diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index ed8f31cec9..5d7f256eb0 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -44,7 +44,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * * @var string */ - static $_matchFields = NULL; + public static $_matchFields = NULL; /** * Fetch object based on array of properties. @@ -336,7 +336,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { $query .= " AND $permissionClause "; } - if ($orderProfiles AND count($profileIds) > 1) { + if ($orderProfiles and count($profileIds) > 1) { $query .= " ORDER BY FIELD( g.id, {$gids} )"; } $group = CRM_Core_DAO::executeQuery($query, $params); @@ -452,9 +452,9 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { $addressCustom = FALSE; if (in_array($permissionType, array( - CRM_Core_Permission::CREATE, - CRM_Core_Permission::EDIT, - )) && + CRM_Core_Permission::CREATE, + CRM_Core_Permission::EDIT, + )) && in_array($field->field_name, array_keys($addressCustomFields)) ) { $addressCustom = TRUE; @@ -1877,9 +1877,9 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $form->addChainSelect($name, array('label' => $title, 'required' => $required)); $config = CRM_Core_Config::singleton(); if (!in_array($mode, array( - CRM_Profile_Form::MODE_EDIT, - CRM_Profile_Form::MODE_SEARCH, - )) && + CRM_Profile_Form::MODE_EDIT, + CRM_Profile_Form::MODE_SEARCH, + )) && $config->defaultContactStateProvince ) { $defaultValues[$name] = $config->defaultContactStateProvince; @@ -1890,9 +1890,9 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $form->add('select', $name, $title, array('' => ts('- select -')) + CRM_Core_PseudoConstant::country(), $required, $selectAttributes); $config = CRM_Core_Config::singleton(); if (!in_array($mode, array( - CRM_Profile_Form::MODE_EDIT, - CRM_Profile_Form::MODE_SEARCH, - )) && + CRM_Profile_Form::MODE_EDIT, + CRM_Profile_Form::MODE_SEARCH, + )) && $config->defaultContactCountry ) { $defaultValues[$name] = $config->defaultContactCountry; @@ -2020,11 +2020,11 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $profileType = CRM_Core_BAO_UFField::getProfileType($gId, TRUE, FALSE, TRUE); if (empty($profileType) || in_array($profileType, array( - 'Contact', - 'Contribution', - 'Participant', - 'Membership', - )) + 'Contact', + 'Contribution', + 'Participant', + 'Membership', + )) ) { $profileType = 'Individual'; } @@ -2138,10 +2138,10 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(); $statusName = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); foreach (array( - 'In Progress', - 'Overdue', - 'Refunded', - ) as $suppress) { + 'In Progress', + 'Overdue', + 'Refunded', + ) as $suppress) { unset($contributionStatuses[CRM_Utils_Array::key($suppress, $statusName)]); } @@ -2841,7 +2841,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @param array $values * @param CRM_Core_Smarty $template */ - static public function profileDisplay($gid, $values, $template) { + public static function profileDisplay($gid, $values, $template) { $groupTitle = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $gid, 'title'); $template->assign('grouptitle', $groupTitle); if (count($values)) { diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index dab5fa3879..39731cfa92 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -60,7 +60,6 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { return $dao; } - /** * Given a UF user object, make sure there is a contact * object for this user. If the user has new values, we need diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index c234f68ccd..f77891ab25 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -80,7 +80,6 @@ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { return $wordReplacement; } - /** * Save the values of a WordReplacement. * diff --git a/CRM/Core/Block.php b/CRM/Core/Block.php index 252aa96319..a34bf4da64 100644 --- a/CRM/Core/Block.php +++ b/CRM/Core/Block.php @@ -54,8 +54,9 @@ class CRM_Core_Block { /** * Template file names for the above blocks. + * @var array */ - static $_properties = NULL; + public static $_properties = NULL; /** * Class constructor. diff --git a/CRM/Core/CodeGen/Config.php b/CRM/Core/CodeGen/Config.php index 9adc75a443..8853913d98 100644 --- a/CRM/Core/CodeGen/Config.php +++ b/CRM/Core/CodeGen/Config.php @@ -4,6 +4,7 @@ * Generate configuration files */ class CRM_Core_CodeGen_Config extends CRM_Core_CodeGen_BaseTask { + public function run() { $this->setupCms(); } diff --git a/CRM/Core/CodeGen/I18n.php b/CRM/Core/CodeGen/I18n.php index d34f30a5d2..9cab2ce446 100644 --- a/CRM/Core/CodeGen/I18n.php +++ b/CRM/Core/CodeGen/I18n.php @@ -4,6 +4,7 @@ * Generate language files and classes */ class CRM_Core_CodeGen_I18n extends CRM_Core_CodeGen_BaseTask { + public function run() { $this->generateInstallLangs(); $this->generateSchemaStructure(); diff --git a/CRM/Core/CodeGen/Main.php b/CRM/Core/CodeGen/Main.php index 978f3e9cae..7729ea81e8 100644 --- a/CRM/Core/CodeGen/Main.php +++ b/CRM/Core/CodeGen/Main.php @@ -4,15 +4,23 @@ * Class CRM_Core_CodeGen_Main */ class CRM_Core_CodeGen_Main { - var $buildVersion; - var $db_version; - var $cms; // drupal, joomla, wordpress + public $buildVersion; + public $db_version; + /** + * drupal, joomla, wordpress + * @var string + */ + public $cms; - var $CoreDAOCodePath; - var $sqlCodePath; - var $phpCodePath; - var $tplCodePath; - var $schemaPath; // ex: schema/Schema.xml + public $CoreDAOCodePath; + public $sqlCodePath; + public $phpCodePath; + public $tplCodePath; + /** + * ex: schema/Schema.xml + * @var string + */ + public $schemaPath; /** * Definitions of all tables. @@ -20,24 +28,24 @@ class CRM_Core_CodeGen_Main { * @var array * Ex: $tables['civicrm_address_format']['className'] = 'CRM_Core_DAO_AddressFormat'; */ - var $tables; + public $tables; /** * @var array * Ex: $database['tableAttributes_modern'] = "ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci"; */ - var $database; + public $database; /** * @var string|NULL path in which to store a marker that indicates the last execution of * GenCode. If a matching marker already exists, GenCode doesn't run. */ - var $digestPath; + public $digestPath; /** * @var string|NULL a digest of the inputs to the code-generator (eg the properties and source files) */ - var $sourceDigest; + public $sourceDigest; /** * @param $CoreDAOCodePath diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index 660d8d6192..e5da1c609a 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -15,6 +15,7 @@ class CRM_Core_CodeGen_Specification { * @param $schemaPath * @param string $buildVersion * Which version of the schema to build. + * @param bool $verbose */ public function parse($schemaPath, $buildVersion, $verbose = TRUE) { $this->buildVersion = $buildVersion; diff --git a/CRM/Core/CodeGen/Test.php b/CRM/Core/CodeGen/Test.php index e87e6539a7..26f7030454 100644 --- a/CRM/Core/CodeGen/Test.php +++ b/CRM/Core/CodeGen/Test.php @@ -4,6 +4,7 @@ * Generate files used during testing. */ class CRM_Core_CodeGen_Test extends CRM_Core_CodeGen_BaseTask { + public function run() { $this->generateCiviTestTruncate(); } diff --git a/CRM/Core/CodeGen/Util/File.php b/CRM/Core/CodeGen/Util/File.php index c2cedac40c..1e77801a70 100644 --- a/CRM/Core/CodeGen/Util/File.php +++ b/CRM/Core/CodeGen/Util/File.php @@ -4,6 +4,7 @@ * Class CRM_Core_CodeGen_Util_File */ class CRM_Core_CodeGen_Util_File { + /** * @param $dir * @param int $perm diff --git a/CRM/Core/CodeGen/Util/Xml.php b/CRM/Core/CodeGen/Util/Xml.php index 96f94477e9..8d64be7006 100644 --- a/CRM/Core/CodeGen/Util/Xml.php +++ b/CRM/Core/CodeGen/Util/Xml.php @@ -4,6 +4,7 @@ * Class CRM_Core_CodeGen_Util_Xml */ class CRM_Core_CodeGen_Util_Xml { + /** * @param string $file * Path to input. diff --git a/CRM/Core/CommunityMessages.php b/CRM/Core/CommunityMessages.php index 9e7ad56aa3..6d660dc495 100644 --- a/CRM/Core/CommunityMessages.php +++ b/CRM/Core/CommunityMessages.php @@ -36,7 +36,8 @@ class CRM_Core_CommunityMessages { /** * Default time to wait before retrying. */ - const DEFAULT_RETRY = 7200; // 2 hours + // 2 hours + const DEFAULT_RETRY = 7200; /** * @var CRM_Utils_HttpClient @@ -96,7 +97,8 @@ class CRM_Core_CommunityMessages { if (empty($document) || !is_array($document)) { $document = [ 'messages' => [], - 'expires' => 0, // ASAP + // ASAP + 'expires' => 0, 'ttl' => self::DEFAULT_RETRY, 'retry' => self::DEFAULT_RETRY, ]; diff --git a/CRM/Core/Component.php b/CRM/Core/Component.php index f7161bc500..9f3dfdac43 100644 --- a/CRM/Core/Component.php +++ b/CRM/Core/Component.php @@ -42,7 +42,10 @@ class CRM_Core_Component { */ const COMPONENT_INFO_CLASS = 'Info'; - static $_contactSubTypes = NULL; + /** + * @var array + */ + public static $_contactSubTypes = NULL; /** * @param bool $force @@ -128,17 +131,16 @@ class CRM_Core_Component { return $componentIDs; } - /** * @param bool $force * * @return CRM_Core_Component_Info[] */ - static public function &getEnabledComponents($force = FALSE) { + public static function &getEnabledComponents($force = FALSE) { return self::_info($force); } - static public function flushEnabledComponents() { + public static function flushEnabledComponents() { unset(Civi::$statics[__CLASS__]); } @@ -388,7 +390,6 @@ class CRM_Core_Component { return self::$_contactSubTypes; } - /** * @param $subType * @param $op diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index cd382e17d6..b9c632feb6 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -138,7 +138,7 @@ class CRM_Core_Config extends CRM_Core_Config_MagicMerge { * @return object * @see Civi::log() */ - static public function &getLog() { + public static function &getLog() { if (!isset(self::$_log)) { self::$_log = Log::singleton('display'); } @@ -181,11 +181,11 @@ class CRM_Core_Config extends CRM_Core_Config_MagicMerge { // Whether we delete/create or simply preserve directories, we should // certainly make sure the restrictions are enforced. foreach ([ - $this->templateCompileDir, - $this->uploadDir, - $this->configAndLogDir, - $this->customFileUploadDir, - ] as $dir) { + $this->templateCompileDir, + $this->uploadDir, + $this->configAndLogDir, + $this->customFileUploadDir, + ] as $dir) { if ($dir && is_dir($dir)) { CRM_Utils_File::restrictAccess($dir); } @@ -576,7 +576,7 @@ class CRM_Core_Config extends CRM_Core_Config_MagicMerge { /** * Is the system permitted to flush caches at the moment. */ - static public function isPermitCacheFlushMode() { + public static function isPermitCacheFlushMode() { return !CRM_Core_Config::singleton()->doNotResetCache; } @@ -589,7 +589,7 @@ class CRM_Core_Config extends CRM_Core_Config_MagicMerge { * @param bool $enabled * If true then caches can be cleared at this time. */ - static public function setPermitCacheFlushMode($enabled) { + public static function setPermitCacheFlushMode($enabled) { CRM_Core_Config::singleton()->doNotResetCache = $enabled ? 0 : 1; } diff --git a/CRM/Core/Config/MagicMerge.php b/CRM/Core/Config/MagicMerge.php index 90aa741bf8..ffb7e64347 100644 --- a/CRM/Core/Config/MagicMerge.php +++ b/CRM/Core/Config/MagicMerge.php @@ -54,7 +54,8 @@ class CRM_Core_Config_MagicMerge { */ private $map; - private $locals, $settings; + private $locals; + private $settings; private $cache = []; @@ -116,7 +117,8 @@ class CRM_Core_Config_MagicMerge { 'userFrameworkBaseURL' => ['user-system', 'getAbsoluteBaseURL'], 'userFrameworkVersion' => ['user-system', 'getVersion'], - 'useFrameworkRelativeBase' => ['user-system', 'getRelativeBaseURL'], // ugh typo. + // ugh typo. + 'useFrameworkRelativeBase' => ['user-system', 'getRelativeBaseURL'], // "setting" properties are loaded through the setting layer, esp // table "civicrm_setting" and global $civicrm_setting. @@ -133,14 +135,16 @@ class CRM_Core_Config_MagicMerge { 'dateformatYear' => ['setting'], 'dateformatFinancialBatch' => ['setting'], 'dateformatshortdate' => ['setting'], - 'debug' => ['setting', 'debug_enabled'], // renamed. + // renamed. + 'debug' => ['setting', 'debug_enabled'], 'defaultContactCountry' => ['setting'], 'defaultContactStateProvince' => ['setting'], 'defaultCurrency' => ['setting'], 'defaultSearchProfileID' => ['setting'], 'doNotAttachPDFReceipt' => ['setting'], 'empoweredBy' => ['setting'], - 'enableComponents' => ['setting', 'enable_components'], // renamed. + // renamed. + 'enableComponents' => ['setting', 'enable_components'], 'enableSSL' => ['setting'], 'fatalErrorHandler' => ['setting'], 'fieldSeparator' => ['setting'], @@ -164,7 +168,8 @@ class CRM_Core_Config_MagicMerge { 'mapAPIKey' => ['setting'], 'mapProvider' => ['setting'], 'maxFileSize' => ['setting'], - 'maxAttachments' => ['setting', 'max_attachments'], // renamed. + // renamed. + 'maxAttachments' => ['setting', 'max_attachments'], 'monetaryDecimalPoint' => ['setting'], 'monetaryThousandSeparator' => ['setting'], 'moneyformat' => ['setting'], diff --git a/CRM/Core/Config/Runtime.php b/CRM/Core/Config/Runtime.php index 51a4cc3d34..d1aef183d9 100644 --- a/CRM/Core/Config/Runtime.php +++ b/CRM/Core/Config/Runtime.php @@ -174,11 +174,16 @@ class CRM_Core_Config_Runtime extends CRM_Core_Config_MagicMerge { public static function getId() { if (!isset(Civi::$statics[__CLASS__]['id'])) { Civi::$statics[__CLASS__]['id'] = md5(implode(\CRM_Core_DAO::VALUE_SEPARATOR, [ - defined('CIVICRM_DOMAIN_ID') ? CIVICRM_DOMAIN_ID : 1, // e.g. one database, multi URL - parse_url(CIVICRM_DSN, PHP_URL_PATH), // e.g. one codebase, multi database - \CRM_Utils_Array::value('SCRIPT_FILENAME', $_SERVER, ''), // e.g. CMS vs extern vs installer - \CRM_Utils_Array::value('HTTP_HOST', $_SERVER, ''), // e.g. name-based vhosts - \CRM_Utils_Array::value('SERVER_PORT', $_SERVER, ''), // e.g. port-based vhosts + // e.g. one database, multi URL + defined('CIVICRM_DOMAIN_ID') ? CIVICRM_DOMAIN_ID : 1, + // e.g. one codebase, multi database + parse_url(CIVICRM_DSN, PHP_URL_PATH), + // e.g. CMS vs extern vs installer + \CRM_Utils_Array::value('SCRIPT_FILENAME', $_SERVER, ''), + // e.g. name-based vhosts + \CRM_Utils_Array::value('HTTP_HOST', $_SERVER, ''), + // e.g. port-based vhosts + \CRM_Utils_Array::value('SERVER_PORT', $_SERVER, ''), // Depending on deployment arch, these signals *could* be redundant, but who cares? ])); } diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index 1bd454992d..a5141627c7 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -276,11 +276,9 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller { public function fini() { CRM_Core_BAO_Cache::storeSessionToCache([ - "_{$this->_name}_container", - ['CiviCRM', $this->_scope], - ], - TRUE - ); + "_{$this->_name}_container", + ['CiviCRM', $this->_scope], + ], TRUE); } /** diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index ea7abcc085..027dba4a89 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -59,14 +59,14 @@ class CRM_Core_DAO extends DB_DataObject { * @var null * @deprecated */ - static $_nullObject = NULL; + public static $_nullObject = NULL; /** * @var array * @deprecated */ - static $_nullArray = []; + public static $_nullArray = []; - static $_dbColumnValueCache = NULL; + public static $_dbColumnValueCache = NULL; const NOT_NULL = 1, IS_NULL = 2, DB_DAO_NOTNULL = 128, VALUE_SEPARATOR = "", @@ -101,18 +101,19 @@ class CRM_Core_DAO extends DB_DataObject { * test objects - this prevents world regions, countries etc from being added / deleted * @var array */ - static $_testEntitiesToSkip = []; + public static $_testEntitiesToSkip = []; /** * The factory class for this application. * @var object */ - static $_factory = NULL; + public static $_factory = NULL; - static $_checkedSqlFunctionsExist = FALSE; + public static $_checkedSqlFunctionsExist = FALSE; /** * https://issues.civicrm.org/jira/browse/CRM-17748 * internal variable for DAO to hold per-query settings + * @var array */ protected $_options = []; @@ -1342,7 +1343,7 @@ FROM civicrm_domain * @return CRM_Core_DAO * Object that points to an unbuffered result set */ - static public function executeUnbufferedQuery( + public static function executeUnbufferedQuery( $query, $params = [], $abort = TRUE, @@ -1985,7 +1986,8 @@ SELECT contact_id $object = new $daoName(); $object->id = CRM_Utils_Array::value('id', $params); - $deletions = []; // array(array(0 => $daoName, 1 => $daoParams)) + // array(array(0 => $daoName, 1 => $daoParams)) + $deletions = []; if ($object->find(TRUE)) { $fields = $object->fields(); @@ -2003,7 +2005,8 @@ SELECT contact_id // to make this test process pass - line below makes pass for now && $dbName != 'member_of_contact_id' ) { - $deletions[] = [$FKClassName, ['id' => $object->$dbName]]; // x + // x + $deletions[] = [$FKClassName, ['id' => $object->$dbName]]; } } } @@ -2358,7 +2361,6 @@ SELECT contact_id } } - /** * Update the fields array to also hold keys for pseudoconstant fields that relate to contained fields. * @@ -2549,7 +2551,8 @@ SELECT contact_id return (sprintf('%s ' . $operator . ' "%s" AND "%s"', $fieldName, CRM_Core_DAO::escapeString($criteria[0]), CRM_Core_DAO::escapeString($criteria[1]))); } else { - return NULL; // not yet implemented (tests required to implement) + // not yet implemented (tests required to implement) + return NULL; } break; @@ -2575,7 +2578,8 @@ SELECT contact_id return (sprintf('%s %s "%s"', $fieldName, $operator, CRM_Core_DAO::escapeString($criteria))); } else { - return NULL; // not yet implemented (tests required to implement) + // not yet implemented (tests required to implement) + return NULL; } } } diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 41895ed7c4..52ee98d4dc 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -43,6 +43,7 @@ require_once 'Log.php'; * Class CRM_Exception */ class CRM_Exception extends PEAR_Exception { + /** * Redefine the exception so message isn't optional. * @@ -94,6 +95,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { /** * If modeException == true, errors are raised as exception instead of returning civicrm_errors + * @var bool */ public static $modeException = NULL; @@ -139,7 +141,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { * * @return array|null|string */ - static public function getMessages(&$error, $separator = '
') { + public static function getMessages(&$error, $separator = '
') { if (is_a($error, 'CRM_Core_Error')) { $errors = $error->getErrors(); $message = []; @@ -208,13 +210,15 @@ class CRM_Core_Error extends PEAR_ErrorStack { $link = $conn->connection; if (mysqli_error($link)) { $mysql_error = mysqli_error($link) . ', ' . mysqli_errno($link); - mysqli_query($link, 'select 1'); // execute a dummy query to clear error stack + // execute a dummy query to clear error stack + mysqli_query($link, 'select 1'); } } elseif ($conn instanceof DB_mysql) { if (mysql_error()) { $mysql_error = mysql_error() . ', ' . mysql_errno(); - mysql_query('select 1'); // execute a dummy query to clear error stack + // execute a dummy query to clear error stack + mysql_query('select 1'); } } else { diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index df614d75e9..b396667fe7 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -162,6 +162,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { /** * Indicate if this form should warn users of unsaved changes + * @var bool */ protected $unsavedChangesWarn; @@ -227,8 +228,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { const CB_PREFIX = 'mark_x_', CB_PREFIY = 'mark_y_', CB_PREFIZ = 'mark_z_', CB_PREFIX_LEN = 7; /** - * @internal to keep track of chain-select fields * @var array + * @internal to keep track of chain-select fields */ private $_chainSelectFields = []; @@ -491,10 +492,9 @@ class CRM_Core_Form extends HTML_QuickForm_Page { // Respond with JSON if in AJAX context (also support legacy value '6') if ($allowAjax && !empty($_REQUEST['snippet']) && in_array($_REQUEST['snippet'], [ - CRM_Core_Smarty::PRINT_JSON, - 6, - ]) - ) { + CRM_Core_Smarty::PRINT_JSON, + 6, + ])) { $this->ajaxResponse['buttonName'] = str_replace('_qf_' . $this->getAttribute('id') . '_', '', $this->controller->getButtonName()); $this->ajaxResponse['action'] = $this->_action; if (isset($this->_id) || isset($this->id)) { @@ -1391,7 +1391,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $props['context'] = $this->getDefaultContext(); } // This is not a required param, so we'll ignore if this doesn't exist. - catch (Exception $e) {} + catch (Exception $e) { + } } // Fetch options from the api unless passed explicitly if (isset($props['options'])) { @@ -1458,7 +1459,9 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * @throws \CiviCRM_API3_Exception * @throws \Exception - * @return HTML_QuickForm_Element + * @return mixed + * HTML_QuickForm_Element + * void */ public function addField($name, $props = [], $required = FALSE, $legacyDate = TRUE) { // Resolve context. @@ -1497,10 +1500,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page { } $isSelect = (in_array($widget, [ - 'Select', - 'CheckBoxGroup', - 'RadioGroup', - 'Radio', + 'Select', + 'CheckBoxGroup', + 'RadioGroup', + 'Radio', ])); if ($isSelect) { @@ -2173,9 +2176,9 @@ class CRM_Core_Form extends HTML_QuickForm_Page { if ($this->canUseAjaxContactLookups()) { $this->assign('selectable', $autoCompleteField['id_field']); $this->addEntityRef($autoCompleteField['id_field'], NULL, [ - 'placeholder' => $autoCompleteField['placeholder'], - 'api' => $autoCompleteField['api'], - ]); + 'placeholder' => $autoCompleteField['placeholder'], + 'api' => $autoCompleteField['api'], + ]); CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/AlternateContactSelector.js', 1, 'html-header') ->addSetting([ @@ -2298,11 +2301,11 @@ class CRM_Core_Form extends HTML_QuickForm_Page { public function addChainSelect($elementName, $settings = []) { $props = $settings += [ 'control_field' => str_replace(['state_province', 'StateProvince', 'county', 'County'], [ - 'country', - 'Country', - 'state_province', - 'StateProvince', - ], $elementName), + 'country', + 'Country', + 'state_province', + 'StateProvince', + ], $elementName), 'data-callback' => strpos($elementName, 'rovince') ? 'civicrm/ajax/jqState' : 'civicrm/ajax/jqCounty', 'label' => strpos($elementName, 'rovince') ? ts('State/Province') : ts('County'), 'data-empty-prompt' => strpos($elementName, 'rovince') ? ts('Choose country first') : ts('Choose state first'), @@ -2337,7 +2340,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { $this->setConstants(['task' => '']); $this->assign('taskMetaData', $tasks); $select = $this->add('select', 'task', NULL, ['' => ts('Actions')], FALSE, [ - 'class' => 'crm-select2 crm-action-menu fa-check-circle-o huge crm-search-result-actions'] + 'class' => 'crm-select2 crm-action-menu fa-check-circle-o huge crm-search-result-actions', + ] ); foreach ($tasks as $key => $task) { $attributes = []; @@ -2428,7 +2432,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page { if (!array_intersect($targetValue, array_keys($options))) { $this->setElementError($target, $controlType == 'country' ? ts('State/Province does not match the selected Country') : ts('County does not match the selected State/Province')); } - } // Suppress "required" error for field if it has no options + } + // Suppress "required" error for field if it has no options elseif (!$options) { $this->setElementError($target, NULL); } diff --git a/CRM/Core/Form/Date.php b/CRM/Core/Form/Date.php index 354762f65b..046f0f8803 100644 --- a/CRM/Core/Form/Date.php +++ b/CRM/Core/Form/Date.php @@ -65,7 +65,6 @@ class CRM_Core_Form_Date { $form->setDefaults(['dateFormats' => self::DATE_yyyy_mm_dd]); } - /** * Retrieve the date range - relative or absolute and assign it to the form. * diff --git a/CRM/Core/Form/EntityFormTrait.php b/CRM/Core/Form/EntityFormTrait.php index 96a15fdcd8..38f2548208 100644 --- a/CRM/Core/Form/EntityFormTrait.php +++ b/CRM/Core/Form/EntityFormTrait.php @@ -30,7 +30,6 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2019 */ - trait CRM_Core_Form_EntityFormTrait { /** @@ -134,27 +133,25 @@ trait CRM_Core_Form_EntityFormTrait { protected function addFormButtons() { if ($this->isViewContext() || $this->_action & CRM_Core_Action::PREVIEW) { $this->addButtons([ - [ - 'type' => 'cancel', - 'name' => ts('Done'), - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'cancel', + 'name' => ts('Done'), + 'isDefault' => TRUE, + ], + ]); } else { $this->addButtons([ - [ - 'type' => 'next', - 'name' => $this->isDeleteContext() ? ts('Delete') : ts('Save'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => $this->isDeleteContext() ? ts('Delete') : ts('Save'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } } @@ -165,8 +162,7 @@ trait CRM_Core_Form_EntityFormTrait { $defaults = $moneyFields = []; if (!$this->isDeleteContext() && - $this->getEntityId() - ) { + $this->getEntityId()) { $params = ['id' => $this->getEntityId()]; $baoName = $this->_BAOName; $baoName::retrieve($params, $defaults); diff --git a/CRM/Core/Form/RecurringEntity.php b/CRM/Core/Form/RecurringEntity.php index 97f7bfaf13..85f53b22e2 100644 --- a/CRM/Core/Form/RecurringEntity.php +++ b/CRM/Core/Form/RecurringEntity.php @@ -38,36 +38,43 @@ class CRM_Core_Form_RecurringEntity { /** * Current entity id + * @var int */ protected static $_entityId = NULL; /** * Schedule Reminder ID + * @var int */ protected static $_scheduleReminderID = NULL; /** * Schedule Reminder data + * @var array */ protected static $_scheduleReminderDetails = []; /** * Parent Entity ID + * @var int */ protected static $_parentEntityId = NULL; /** * Exclude date information + * @var array */ public static $_excludeDateInfo = []; /** * Entity Table + * @var string */ public static $_entityTable; /** * Checks current entityID has parent + * @var string */ public static $_hasParent = FALSE; @@ -219,17 +226,16 @@ class CRM_Core_Form_RecurringEntity { $form->add('text', 'exclude_date_list', ts('Exclude Dates'), ['class' => 'twenty']); $form->addElement('hidden', 'allowRepeatConfigToSubmit', '', ['id' => 'allowRepeatConfigToSubmit']); $form->addButtons([ - [ - 'type' => 'submit', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'submit', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); // For client-side pluralization $form->assign('recurringFrequencyOptions', [ 'single' => CRM_Utils_Array::makeNonAssociative(CRM_Core_SelectValues::getRecurringFrequencyUnits()), diff --git a/CRM/Core/Form/Renderer.php b/CRM/Core/Form/Renderer.php index 201c266f07..0809b46099 100644 --- a/CRM/Core/Form/Renderer.php +++ b/CRM/Core/Form/Renderer.php @@ -53,7 +53,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { * * @var array */ - static $_sizeMapper = [ + public static $_sizeMapper = [ 2 => 'two', 4 => 'four', 6 => 'six', @@ -370,9 +370,9 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty { } } $field->setAttribute('data-entity-value', json_encode([ - 'id' => $contact['id'], - 'text' => implode(' :: ', $view), - ])); + 'id' => $contact['id'], + 'text' => implode(' :: ', $view), + ])); } } } diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index 836ed37eec..cb5839bf87 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -170,6 +170,8 @@ class CRM_Core_Form_Search extends CRM_Core_Form { * * @param array $fields * Posted values of the form. + * @param array $files + * @param object $form * * @return array * list of errors to be posted back to the form diff --git a/CRM/Core/Form/ShortCode.php b/CRM/Core/Form/ShortCode.php index 8d5d2b1ad1..7d77c4c0fb 100644 --- a/CRM/Core/Form/ShortCode.php +++ b/CRM/Core/Form/ShortCode.php @@ -44,13 +44,13 @@ class CRM_Core_Form_ShortCode extends CRM_Core_Form { * Values should be an array with label and select. * Select can be NULL if there is no entity to select. * Otherwise it contains the shortcode key for this entity id (usually 'id') plus an array of params for the EntityRef field - * @see CRM_Core_Form::addEntityRef * * @var array * [component => [ * label => Option Label * select => key + EntityRef params * ]] + * @see CRM_Core_Form::addEntityRef */ public $components = []; @@ -65,7 +65,6 @@ class CRM_Core_Form_ShortCode extends CRM_Core_Form { */ public $options = []; - /** * Build form data. Can be modified via hook_civicrm_preProcess. */ diff --git a/CRM/Core/Form/Task.php b/CRM/Core/Form/Task.php index c79fcf5321..d9279d2000 100644 --- a/CRM/Core/Form/Task.php +++ b/CRM/Core/Form/Task.php @@ -80,14 +80,14 @@ abstract class CRM_Core_Form_Task extends CRM_Core_Form { * * @var string */ - static $tableName = NULL; + public static $tableName = NULL; /** * Must be set to entity shortname (eg. event) * * @var string */ - static $entityShortname = NULL; + public static $entityShortname = NULL; /** * Build all the data structures needed to build the form. @@ -195,17 +195,16 @@ abstract class CRM_Core_Form_Task extends CRM_Core_Form { */ public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) { $this->addButtons([ - [ - 'type' => $nextType, - 'name' => $title, - 'isDefault' => TRUE, - ], - [ - 'type' => $backType, - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => $nextType, + 'name' => $title, + 'isDefault' => TRUE, + ], + [ + 'type' => $backType, + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Core/Form/Task/Batch.php b/CRM/Core/Form/Task/Batch.php index 76d1b85756..9e56fe9292 100644 --- a/CRM/Core/Form/Task/Batch.php +++ b/CRM/Core/Form/Task/Batch.php @@ -44,6 +44,7 @@ class CRM_Core_Form_Task_Batch extends CRM_Core_Form_Task { /** * Maximum profile fields that will be displayed. + * @var int */ protected $_maxFields = 9; @@ -52,10 +53,16 @@ class CRM_Core_Form_Task_Batch extends CRM_Core_Form_Task { */ protected $_fields; - // Must be set to entity table name (eg. civicrm_participant) by child class - static $tableName = NULL; - // Must be set to entity shortname (eg. event) - static $entityShortname = NULL; + /** + * Must be set to entity table name (eg. civicrm_participant) by child class + * @var string + */ + public static $tableName = NULL; + /** + * Must be set to entity shortname (eg. event) + * @var string + */ + public static $entityShortname = NULL; /** * Build all the data structures needed to build the form. diff --git a/CRM/Core/Form/Task/PDFLetterCommon.php b/CRM/Core/Form/Task/PDFLetterCommon.php index 5fd95efa67..171d5c7846 100644 --- a/CRM/Core/Form/Task/PDFLetterCommon.php +++ b/CRM/Core/Form/Task/PDFLetterCommon.php @@ -132,15 +132,15 @@ class CRM_Core_Form_Task_PDFLetterCommon { $config = CRM_Core_Config::singleton(); /** CRM-15883 Suppressing Stationery path field until we switch from DOMPDF to a library that supports it. - if ($config->wkhtmltopdfPath == FALSE) { - $form->add( - 'text', - 'stationery', - ts('Stationery (relative path to PDF you wish to use as the background)'), - array('size' => 25, 'maxlength' => 900, 'onkeyup' => "showUpdateFormatChkBox();"), - FALSE - ); - } + * if ($config->wkhtmltopdfPath == FALSE) { + * $form->add( + * 'text', + * 'stationery', + * ts('Stationery (relative path to PDF you wish to use as the background)'), + * array('size' => 25, 'maxlength' => 900, 'onkeyup' => "showUpdateFormatChkBox();"), + * FALSE + * ); + * } */ $form->add('checkbox', 'bind_format', ts('Always use this Page Format with the selected Template')); $form->add('checkbox', 'update_format', ts('Update Page Format (this will affect all templates that use this format)')); diff --git a/CRM/Core/Form/Task/PickProfile.php b/CRM/Core/Form/Task/PickProfile.php index 4043833a55..926fdf3097 100644 --- a/CRM/Core/Form/Task/PickProfile.php +++ b/CRM/Core/Form/Task/PickProfile.php @@ -61,14 +61,14 @@ abstract class CRM_Core_Form_Task_PickProfile extends CRM_Core_Form_Task { * * @var string */ - static $tableName = NULL; + public static $tableName = NULL; /** * Must be set to entity shortname (eg. event) * * @var string */ - static $entityShortname = NULL; + public static $entityShortname = NULL; /** * Build all the data structures needed to build the form. diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index 425565de5b..217aec7397 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -71,11 +71,13 @@ class CRM_Core_I18n { /** * A PHP-gettext instance for string translation; * should stay null if the strings are not to be translated (en_US). + * @var object */ private $_phpgettext = NULL; /** * Whether we are using native gettext or not. + * @var bool */ private $_nativegettext = FALSE; @@ -83,6 +85,7 @@ class CRM_Core_I18n { * Gettext cache for extension domains/streamers, depending on if native or phpgettext. * - native gettext: we cache the value for textdomain() * - phpgettext: we cache the file streamer. + * @var array */ private $_extensioncache = []; @@ -243,8 +246,8 @@ class CRM_Core_I18n { /** * Return the available UI languages - * @return array(string languageCode) if $justCodes - * array(string languageCode => string languageName) if !$justCodes + * @return array|string + * array(string languageCode => string languageName) if !$justCodes */ public static function uiLanguages($justCodes = FALSE) { // In multilang we only allow the languages that are configured in db @@ -617,7 +620,6 @@ class CRM_Core_I18n { return FALSE; } - /** * Is the CiviCRM in multilingual mode. * diff --git a/CRM/Core/I18n/Form.php b/CRM/Core/I18n/Form.php index 8433616cdd..bc8b776af1 100644 --- a/CRM/Core/I18n/Form.php +++ b/CRM/Core/I18n/Form.php @@ -33,6 +33,7 @@ * */ class CRM_Core_I18n_Form extends CRM_Core_Form { + public function buildQuickForm() { $config = CRM_Core_Config::singleton(); $tsLocale = CRM_Core_I18n::getLocale(); diff --git a/CRM/Core/I18n/NativeGettext.php b/CRM/Core/I18n/NativeGettext.php index 721b37c1b8..cec8fbfa6e 100644 --- a/CRM/Core/I18n/NativeGettext.php +++ b/CRM/Core/I18n/NativeGettext.php @@ -34,6 +34,7 @@ * Convenience class for PHP-Gettext compatibility. */ class CRM_Core_I18n_NativeGettext { + /** * @param $string * diff --git a/CRM/Core/I18n/SchemaStructure.php b/CRM/Core/I18n/SchemaStructure.php index 5bc0a76f01..e2468d6e6a 100644 --- a/CRM/Core/I18n/SchemaStructure.php +++ b/CRM/Core/I18n/SchemaStructure.php @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * @@ -42,7 +42,7 @@ class CRM_Core_I18n_SchemaStructure { * A table-indexed array of translatable columns. */ public static function &columns() { - static $result = null; + static $result = NULL; if (!$result) { $result = [ 'civicrm_location_type' => [ @@ -214,7 +214,7 @@ class CRM_Core_I18n_SchemaStructure { * Indices for translatable fields. */ public static function &indices() { - static $result = null; + static $result = NULL; if (!$result) { $result = [ 'civicrm_custom_group' => [ @@ -257,8 +257,8 @@ class CRM_Core_I18n_SchemaStructure { * @return array * Array of names of tables with fields that can be translated. */ - static function &tables() { - static $result = null; + public static function &tables() { + static $result = NULL; if (!$result) { $result = array_keys(self::columns()); } @@ -271,8 +271,8 @@ class CRM_Core_I18n_SchemaStructure { * @return array * Array of the widgets for editing translatable fields. */ - static function &widgets() { - static $result = null; + public static function &widgets() { + static $result = NULL; if (!$result) { $result = [ 'civicrm_location_type' => [ diff --git a/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php b/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php index 2450e0f277..cfb456f973 100644 --- a/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_4_2_alpha1.php @@ -33,6 +33,7 @@ * */ class CRM_Core_I18n_SchemaStructure_4_2_alpha1 { + /** * @return array */ diff --git a/CRM/Core/I18n/SchemaStructure_4_3_1.php b/CRM/Core/I18n/SchemaStructure_4_3_1.php index 6078d089ed..69f038d049 100644 --- a/CRM/Core/I18n/SchemaStructure_4_3_1.php +++ b/CRM/Core/I18n/SchemaStructure_4_3_1.php @@ -33,6 +33,7 @@ * */ class CRM_Core_I18n_SchemaStructure_4_3_1 { + /** * @return array */ diff --git a/CRM/Core/I18n/SchemaStructure_4_5_alpha1.php b/CRM/Core/I18n/SchemaStructure_4_5_alpha1.php index 0ecc107866..c5cb4f4431 100644 --- a/CRM/Core/I18n/SchemaStructure_4_5_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_4_5_alpha1.php @@ -34,6 +34,7 @@ * DO NOT EDIT. Generated by CRM_Core_CodeGen */ class CRM_Core_I18n_SchemaStructure_4_5_alpha1 { + /** * @return array */ diff --git a/CRM/Core/IDS.php b/CRM/Core/IDS.php index 648b680d22..92af8f69c2 100644 --- a/CRM/Core/IDS.php +++ b/CRM/Core/IDS.php @@ -34,6 +34,7 @@ class CRM_Core_IDS { /** * Define the threshold for the ids reactions. + * @var array */ private $threshold = [ 'log' => 25, diff --git a/CRM/Core/InnoDBIndexer.php b/CRM/Core/InnoDBIndexer.php index 123792a656..bdf45c9885 100644 --- a/CRM/Core/InnoDBIndexer.php +++ b/CRM/Core/InnoDBIndexer.php @@ -206,7 +206,8 @@ class CRM_Core_InnoDBIndexer { * (string $indexName => string $sql) */ public function buildIndexSql($table) { - $sqls = []; // array (string $idxName => string $sql) + // array (string $idxName => string $sql) + $sqls = []; if ($this->isActive && isset($this->indices[$table])) { foreach ($this->indices[$table] as $fields) { $name = self::IDX_PREFIX . md5($table . '::' . implode(',', $fields)); diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 15ff125b0b..9a9e04a932 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -77,7 +77,8 @@ class CRM_Core_Invoke { if (!defined('CIVICRM_SYMFONY_PATH')) { // Traditional Civi invocation path - self::hackMenuRebuild($args); // may exit + // may exit + self::hackMenuRebuild($args); self::init($args); self::hackStandalone($args); $item = self::getItem($args); @@ -108,13 +109,14 @@ class CRM_Core_Invoke { * List of path parts. * @void */ - static public function hackMenuRebuild($args) { + public static function hackMenuRebuild($args) { if (['civicrm', 'menu', 'rebuild'] == $args || ['civicrm', 'clearcache'] == $args) { // ensure that the user has a good privilege level if (CRM_Core_Permission::check('administer CiviCRM')) { self::rebuildMenuAndCaches(); CRM_Core_Session::setStatus(ts('Cleared all CiviCRM caches (database, menu, templates)'), ts('Complete'), 'success'); - return CRM_Utils_System::redirect(); // exits + // exits + return CRM_Utils_System::redirect(); } else { CRM_Core_Error::fatal('You do not have permission to execute this url'); @@ -129,7 +131,7 @@ class CRM_Core_Invoke { * List of path parts. * @void */ - static public function init($args) { + public static function init($args) { // first fire up IDS and check for bad stuff $config = CRM_Core_Config::singleton(); @@ -145,7 +147,7 @@ class CRM_Core_Invoke { * List of path parts. * @void */ - static public function hackStandalone($args) { + public static function hackStandalone($args) { $config = CRM_Core_Config::singleton(); if ($config->userFramework == 'Standalone') { $session = CRM_Core_Session::singleton(); @@ -165,7 +167,7 @@ class CRM_Core_Invoke { * List of path parts. * @return array; see CRM_Core_Menu */ - static public function getItem($args) { + public static function getItem($args) { if (is_array($args)) { // get the menu items $path = implode('/', $args); @@ -192,7 +194,7 @@ class CRM_Core_Invoke { * See CRM_Core_Menu. * @return string, HTML */ - static public function runItem($item) { + public static function runItem($item) { $ids = new CRM_Core_IDS(); $ids->check($item); diff --git a/CRM/Core/JobManager.php b/CRM/Core/JobManager.php index 5d269cf24a..d583a1c951 100644 --- a/CRM/Core/JobManager.php +++ b/CRM/Core/JobManager.php @@ -37,17 +37,16 @@ class CRM_Core_JobManager { /** * @var array ($id => CRM_Core_ScheduledJob) */ - var $jobs = NULL; + public $jobs = NULL; /** * @var CRM_Core_ScheduledJob */ - var $currentJob = NULL; + public $currentJob = NULL; - var $singleRunParams = []; - - var $_source = NULL; + public $singleRunParams = []; + public $_source = NULL; /** * Class constructor. diff --git a/CRM/Core/Key.php b/CRM/Core/Key.php index fb8c6739f0..4424057911 100644 --- a/CRM/Core/Key.php +++ b/CRM/Core/Key.php @@ -33,9 +33,9 @@ * */ class CRM_Core_Key { - static $_key = NULL; + public static $_key = NULL; - static $_sessionID = NULL; + public static $_sessionID = NULL; /** * Generate a private key per session and store in session. diff --git a/CRM/Core/LegacyErrorHandler.php b/CRM/Core/LegacyErrorHandler.php index 837fbc34c4..ae0f1f9859 100644 --- a/CRM/Core/LegacyErrorHandler.php +++ b/CRM/Core/LegacyErrorHandler.php @@ -4,6 +4,7 @@ * Class CRM_Core_LegacyErrorHandler */ class CRM_Core_LegacyErrorHandler { + /** * @param \Civi\Core\Event\UnhandledExceptionEvent $event * @throws Exception diff --git a/CRM/Core/Lock.php b/CRM/Core/Lock.php index 789639506c..31077138e6 100644 --- a/CRM/Core/Lock.php +++ b/CRM/Core/Lock.php @@ -44,11 +44,16 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface { * * @var bool */ - static $jobLog = FALSE; + public static $jobLog = FALSE; - // lets have a 3 second timeout for now + /** + * lets have a 3 second timeout for now + */ const TIMEOUT = 3; + /** + * @var bool + */ protected $_hasLock = FALSE; protected $_name; diff --git a/CRM/Core/ManagedEntities.php b/CRM/Core/ManagedEntities.php index f5ee0c38ca..a388328696 100644 --- a/CRM/Core/ManagedEntities.php +++ b/CRM/Core/ManagedEntities.php @@ -259,7 +259,8 @@ class CRM_Core_ManagedEntities { if ($doUpdate) { $defaults = [ 'id' => $dao->entity_id, - 'is_active' => 1, // FIXME: test whether is_active is valid + // FIXME: test whether is_active is valid + 'is_active' => 1, ]; $params = array_merge($defaults, $todo['params']); $result = civicrm_api($dao->entity_type, 'create', $params); diff --git a/CRM/Core/Menu.php b/CRM/Core/Menu.php index 8ceccdd854..7964911204 100644 --- a/CRM/Core/Menu.php +++ b/CRM/Core/Menu.php @@ -44,16 +44,16 @@ class CRM_Core_Menu { * * @var array */ - static $_items = NULL; + public static $_items = NULL; /** * The list of permissioned menu items. * * @var array */ - static $_permissionedItems = NULL; + public static $_permissionedItems = NULL; - static $_serializedElements = array( + public static $_serializedElements = array( 'access_arguments', 'access_callback', 'page_arguments', @@ -61,7 +61,7 @@ class CRM_Core_Menu { 'breadcrumb', ); - static $_menuCache = NULL; + public static $_menuCache = NULL; const MENU_ITEM = 1; /** @@ -367,13 +367,12 @@ class CRM_Core_Menu { 'title' => $item['title'], 'desc' => CRM_Utils_Array::value('desc', $item), 'id' => strtr($item['title'], array( - '(' => '_', - ')' => '', - ' ' => '', - ',' => '_', - '/' => '_', - ) - ), + '(' => '_', + ')' => '', + ' ' => '', + ',' => '_', + '/' => '_', + )), 'url' => CRM_Utils_System::url($path, $query, FALSE, NULL, @@ -570,11 +569,16 @@ class CRM_Core_Menu { 'title' => $menu[$currentPath]['title'], 'url' => CRM_Utils_System::url($currentPath, 'reset=1' . $urlVar, - FALSE, // absolute - NULL, // fragment - TRUE, // htmlize - FALSE, // frontend - TRUE // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend + // absolute + FALSE, + // fragment + NULL, + // htmlize + TRUE, + // frontend + FALSE, + // forceBackend; CRM-14439 work-around; acceptable for now because we don't display breadcrumbs on frontend + TRUE ), ); } diff --git a/CRM/Core/Module.php b/CRM/Core/Module.php index eca6f6e38d..f3976d1c8c 100644 --- a/CRM/Core/Module.php +++ b/CRM/Core/Module.php @@ -68,7 +68,8 @@ class CRM_Core_Module { static $result; if ($fresh || !is_array($result)) { $result = CRM_Extension_System::singleton()->getMapper()->getModules(); - $result[] = new CRM_Core_Module('civicrm', TRUE); // pseudo-module for core + // pseudo-module for core + $result[] = new CRM_Core_Module('civicrm', TRUE); $config = CRM_Core_Config::singleton(); $result = array_merge($result, $config->userSystem->getModules()); diff --git a/CRM/Core/OptionGroup.php b/CRM/Core/OptionGroup.php index 94368ec6a3..913f874d50 100644 --- a/CRM/Core/OptionGroup.php +++ b/CRM/Core/OptionGroup.php @@ -31,14 +31,15 @@ * @copyright CiviCRM LLC (c) 2004-2019 */ class CRM_Core_OptionGroup { - static $_values = []; - static $_cache = []; + public static $_values = []; + public static $_cache = []; /** * $_domainIDGroups array maintains the list of option groups for whom * domainID is to be considered. + * @var array */ - static $_domainIDGroups = [ + public static $_domainIDGroups = [ 'from_email_address', 'grant_type', ]; @@ -615,13 +616,13 @@ WHERE v.option_group_id = g.id if ($dao->fetch()) { foreach ([ - 'id', - 'name', - 'value', - 'label', - 'weight', - 'description', - ] as $fld) { + 'id', + 'name', + 'value', + 'label', + 'weight', + 'description', + ] as $fld) { $row[$fld] = $dao->$fld; if ($localize && in_array($fld, ['label', 'description'])) { $row[$fld] = ts($row[$fld]); diff --git a/CRM/Core/OptionValue.php b/CRM/Core/OptionValue.php index 7390deb4ce..ed649405cd 100644 --- a/CRM/Core/OptionValue.php +++ b/CRM/Core/OptionValue.php @@ -37,21 +37,21 @@ class CRM_Core_OptionValue { * * @var array */ - static $_exportableFields = NULL; + public static $_exportableFields = NULL; /** * Static field for all the option value information that we can potentially export. * * @var array */ - static $_importableFields = NULL; + public static $_importableFields = NULL; /** * Static field for all the option value information that we can potentially export. * * @var array */ - static $_fields = NULL; + public static $_fields = NULL; /** * Return option-values of a particular group diff --git a/CRM/Core/Page/AJAX/Attachment.php b/CRM/Core/Page/AJAX/Attachment.php index f06559285e..69b9c3c397 100644 --- a/CRM/Core/Page/AJAX/Attachment.php +++ b/CRM/Core/Page/AJAX/Attachment.php @@ -41,7 +41,8 @@ */ class CRM_Core_Page_AJAX_Attachment { - const ATTACHMENT_TOKEN_TTL = 10800; // 3hr; 3*60*60 + // 3hr; 3*60*60 + const ATTACHMENT_TOKEN_TTL = 10800; /** * (Page Callback) diff --git a/CRM/Core/Page/AJAX/Location.php b/CRM/Core/Page/AJAX/Location.php index 04066e4bd1..7a998fe2a5 100644 --- a/CRM/Core/Page/AJAX/Location.php +++ b/CRM/Core/Page/AJAX/Location.php @@ -51,7 +51,7 @@ class CRM_Core_Page_AJAX_Location { // Verify user id $user = CRM_Utils_Request::retrieve('uid', 'Integer', CRM_Core_DAO::$_nullObject, FALSE, CRM_Core_Session::singleton() - ->get('userID')); + ->get('userID')); if (empty($user) || (CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE) && !CRM_Contact_BAO_Contact_Permission::validateChecksumContact($user, CRM_Core_DAO::$_nullObject, FALSE)) ) { CRM_Utils_System::civiExit(); @@ -227,10 +227,9 @@ class CRM_Core_Page_AJAX_Location { // lets output only required fields. foreach ($addressOptions as $element => $isSet) { if ($isSet && (!in_array($element, [ - 'im', - 'openid', - ])) - ) { + 'im', + 'openid', + ]))) { if (in_array($element, [ 'country', 'state_province', @@ -253,10 +252,10 @@ class CRM_Core_Page_AJAX_Location { } foreach ([ - 'email', - 'phone_type_id', - 'phone', - ] as $element) { + 'email', + 'phone_type_id', + 'phone', + ] as $element) { $block = ($element == 'phone_type_id') ? 'phone' : $element; for ($i = 1; $i < 3; $i++) { $fld = "{$block}[{$i}][{$element}]"; diff --git a/CRM/Core/Page/File.php b/CRM/Core/Page/File.php index e3b12d2a92..362e3d1616 100644 --- a/CRM/Core/Page/File.php +++ b/CRM/Core/Page/File.php @@ -42,9 +42,12 @@ class CRM_Core_Page_File extends CRM_Core_Page { $download = CRM_Utils_Request::retrieve('download', 'Integer', $this, FALSE, 1); $disposition = $download == 0 ? 'inline' : 'download'; - $entityId = CRM_Utils_Request::retrieve('eid', 'Positive', $this, FALSE); // Entity ID (e.g. Contact ID) - $fieldId = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE); // Field ID - $fileId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE); // File ID + // Entity ID (e.g. Contact ID) + $entityId = CRM_Utils_Request::retrieve('eid', 'Positive', $this, FALSE); + // Field ID + $fieldId = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE); + // File ID + $fileId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE); $fileName = CRM_Utils_Request::retrieve('filename', 'String', $this, FALSE); if (empty($fileName) && (empty($entityId) || empty($fileId))) { CRM_Core_Error::statusBounce("Cannot access file: Must pass either \"Filename\" or the combination of \"Entity ID\" + \"File ID\""); diff --git a/CRM/Core/Page/Inline/Help.php b/CRM/Core/Page/Inline/Help.php index ed2d57e68a..4920f1857f 100644 --- a/CRM/Core/Page/Inline/Help.php +++ b/CRM/Core/Page/Inline/Help.php @@ -36,6 +36,7 @@ * This loads a smarty help file via ajax and returns as html */ class CRM_Core_Page_Inline_Help { + public function run() { $args = $_REQUEST; if (!empty($args['file']) && strpos($args['file'], '..') === FALSE) { diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 1aaa4aa5f5..9399504e16 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -80,6 +80,9 @@ abstract class CRM_Core_Payment { RECURRING_PAYMENT_START = 'START', RECURRING_PAYMENT_END = 'END'; + /** + * @var object + */ protected $_paymentProcessor; /** @@ -108,9 +111,9 @@ abstract class CRM_Core_Payment { * * (Deprecated parameter but used in some messages). * + * @var string * @deprecated * - * @var string */ public $_processorName; @@ -520,9 +523,9 @@ abstract class CRM_Core_Payment { case 'contributionPageRecurringHelp': // require exactly two parameters if (array_keys($params) == [ - 'is_recur_installments', - 'is_email_receipt', - ]) { + 'is_recur_installments', + 'is_email_receipt', + ]) { $gotText = ts('Your recurring contribution will be processed automatically.'); if ($params['is_recur_installments']) { $gotText .= ' ' . ts('You can specify the number of installments, or you can leave the number of installments blank if you want to make an open-ended commitment. In either case, you can choose to cancel at any time.'); @@ -910,7 +913,7 @@ abstract class CRM_Core_Payment { * @param int $billingLocationID * * @return array - * Array of metadata for address fields. + * Array of metadata for address fields. */ public function getBillingAddressFieldsMetadata($billingLocationID = NULL) { if (!$billingLocationID) { @@ -1012,8 +1015,8 @@ abstract class CRM_Core_Payment { 'title' => ts('Country'), 'cc_field' => TRUE, 'attributes' => [ - '' => ts('- select -'), - ] + CRM_Core_PseudoConstant::country(), + '' => ts('- select -'), + ] + CRM_Core_PseudoConstant::country(), 'is_required' => TRUE, ]; return $metadata; diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index 0d39e192ac..dbdcdcbcac 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -355,8 +355,10 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * @return array */ public function _getAuthorizeNetFields() { - $amount = $this->_getParam('total_amount');//Total amount is from the form contribution field - if (empty($amount)) {//CRM-9894 would this ever be the case?? + //Total amount is from the form contribution field + $amount = $this->_getParam('total_amount'); + //CRM-9894 would this ever be the case?? + if (empty($amount)) { $amount = $this->_getParam('amount'); } $fields = []; @@ -728,7 +730,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { /** * Process incoming notification. */ - static public function handlePaymentNotification() { + public static function handlePaymentNotification() { $ipnClass = new CRM_Core_Payment_AuthorizeNetIPN(array_merge($_GET, $_REQUEST)); $ipnClass->main(); } diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index b68bd8cf2c..a6beaf1231 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -85,7 +85,7 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { 'is_test' => 0, 'options' => ['limit' => 1], 'payment_processor_type_id' => $paymentProcessorTypeID, - 'return' => 'id', + 'return' => 'id', ]); } diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index e538c84ecd..35af834bd5 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -30,7 +30,7 @@ */ class CRM_Core_Payment_BaseIPN { - static $_now = NULL; + public static $_now = NULL; /** * Input parameters from payment processor. Store these so that @@ -41,19 +41,19 @@ class CRM_Core_Payment_BaseIPN { /** * Only used by AuthorizeNetIPN. + * @var bool * * @deprecated * - * @var bool */ protected $_isRecurring = FALSE; /** * Only used by AuthorizeNetIPN. + * @var bool * * @deprecated * - * @var bool */ protected $_isFirstOrLastRecurringPayment = FALSE; @@ -232,9 +232,9 @@ class CRM_Core_Payment_BaseIPN { // CRM-15546 $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', [ - 'labelColumn' => 'name', - 'flip' => 1, - ]); + 'labelColumn' => 'name', + 'flip' => 1, + ]); $contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date); $contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date); $contribution->thankyou_date = CRM_Utils_Date::isoToMysql($contribution->thankyou_date); @@ -257,9 +257,9 @@ class CRM_Core_Payment_BaseIPN { if (!empty($memberships)) { // if transaction is failed then set "Cancelled" as membership status $membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', [ - 'labelColumn' => 'name', - 'flip' => 1, - ]); + 'labelColumn' => 'name', + 'flip' => 1, + ]); foreach ($memberships as $membership) { if ($membership) { $membership->status_id = $membershipStatuses['Cancelled']; @@ -322,9 +322,9 @@ class CRM_Core_Payment_BaseIPN { $addLineItems = TRUE; } $contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', [ - 'labelColumn' => 'name', - 'flip' => 1, - ]); + 'labelColumn' => 'name', + 'flip' => 1, + ]); $contribution->contribution_status_id = $contributionStatuses['Cancelled']; $contribution->cancel_date = self::$_now; $contribution->cancel_reason = CRM_Utils_Array::value('reasonCode', $input); @@ -348,9 +348,9 @@ class CRM_Core_Payment_BaseIPN { if (empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) { if (!empty($memberships)) { $membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', [ - 'labelColumn' => 'name', - 'flip' => 1, - ]); + 'labelColumn' => 'name', + 'flip' => 1, + ]); // Cancel only Pending memberships // CRM-18688 $pendingStatusId = $membershipStatuses['Pending']; diff --git a/CRM/Core/Payment/FirstData.php b/CRM/Core/Payment/FirstData.php index 38b0b2dc48..a123e8f85d 100644 --- a/CRM/Core/Payment/FirstData.php +++ b/CRM/Core/Payment/FirstData.php @@ -309,6 +309,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment { return $params; } } + // end function doDirectPayment /** diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index 09b39a2362..027904845b 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -33,7 +33,6 @@ */ class CRM_Core_Payment_Form { - /** * Add payment fields depending on payment processor. * @@ -55,7 +54,7 @@ class CRM_Core_Payment_Form { * @param int $paymentInstrumentID * ID of the payment processor. */ - static public function setPaymentFieldsByProcessor(&$form, $processor, $billing_profile_id = NULL, $isBackOffice = FALSE, $paymentInstrumentID = NULL) { + public static function setPaymentFieldsByProcessor(&$form, $processor, $billing_profile_id = NULL, $isBackOffice = FALSE, $paymentInstrumentID = NULL) { $form->billingFieldSets = []; // Load the pay-later processor // @todo load this right up where the other processors are loaded initially. @@ -84,7 +83,7 @@ class CRM_Core_Payment_Form { * @param CRM_Core_Form $form * @param CRM_Core_Payment $processor */ - static protected function setBillingAddressFields(&$form, $processor) { + protected static function setBillingAddressFields(&$form, $processor) { $billingID = $form->_bltID; $smarty = CRM_Core_Smarty::singleton(); $smarty->assign('billingDetailsFields', self::getBillingAddressFields($processor, $billingID)); diff --git a/CRM/Core/Payment/PayJunction.php b/CRM/Core/Payment/PayJunction.php index 0dcbecf453..42eeb94d4a 100644 --- a/CRM/Core/Payment/PayJunction.php +++ b/CRM/Core/Payment/PayJunction.php @@ -170,6 +170,7 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { return $params; } + // end function doDirectPayment /** @@ -190,7 +191,6 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { } } - /** * ignore for now, more elaborate error handling later. * @param $response diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 155fae1d57..cb68eff201 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -33,7 +33,7 @@ */ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { - static $_paymentProcessor = NULL; + public static $_paymentProcessor = NULL; /** * Input parameters from payment processor. Store these so that @@ -404,7 +404,6 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { } } - /** * Gets PaymentProcessorID for PayPal * @@ -451,7 +450,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { ]; $paymentProcessorID = civicrm_api3('PaymentProcessor', 'getvalue', $processorParams); if (empty($paymentProcessorID)) { - Throw new CRM_Core_Exception('PayPalIPN: Could not get Payment Processor ID'); + throw new CRM_Core_Exception('PayPalIPN: Could not get Payment Processor ID'); } return $paymentProcessorID; } diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index badb5e22eb..5b4a109802 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -743,7 +743,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - static public function handlePaymentNotification() { + public static function handlePaymentNotification() { $params = array_merge($_GET, $_REQUEST); $q = explode('/', CRM_Utils_Array::value('q', $params, '')); $lastParam = array_pop($q); diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index 4e0bcb46b0..d88f12de7d 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -32,7 +32,7 @@ */ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { - static $_paymentProcessor = NULL; + public static $_paymentProcessor = NULL; /** * Input parameters from payment processor. Store these so that @@ -49,6 +49,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { /** * Is this a payment express transaction. + * @var bool */ protected $_isPaymentExpress = FALSE; @@ -215,9 +216,9 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { switch ($txnType) { case 'recurring_payment_profile_created': if (in_array($recur->contribution_status_id, [ - $contributionStatuses['Pending'], - $contributionStatuses['In Progress'], - ]) + $contributionStatuses['Pending'], + $contributionStatuses['In Progress'], + ]) && !empty($recur->processor_id) ) { echo "already handled"; @@ -588,11 +589,11 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr } // arg api won't get this - fix it $ids['contributionPage'] = CRM_Core_DAO::singleValueQuery("SELECT contribution_page_id FROM civicrm_contribution WHERE invoice_id = %1", [ - 1 => [ - $ids['contribution'], - 'Integer', - ], - ]); + 1 => [ + $ids['contribution'], + 'Integer', + ], + ]); // only handle component at this stage - not terribly sure how a recurring event payment would arise // & suspec main function may be a victom of copy & paste // membership would be an easy add - but not relevant to my customer... diff --git a/CRM/Core/Payment/PayflowPro.php b/CRM/Core/Payment/PayflowPro.php index 46541a4b16..1d4b92c5e9 100644 --- a/CRM/Core/Payment/PayflowPro.php +++ b/CRM/Core/Payment/PayflowPro.php @@ -44,6 +44,7 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * the processor. It is the main function for processing on-server * credit card transactions */ + /** * This function collects all the information from a web/api form and invokes * the relevant payment processor specific functions to perform the transaction @@ -363,7 +364,6 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { return $e; } - /** * NOTE: 'doTransferCheckout' not implemented * diff --git a/CRM/Core/Payment/PaymentExpressIPN.php b/CRM/Core/Payment/PaymentExpressIPN.php index 8683a65f85..e3e5b0d1a0 100644 --- a/CRM/Core/Payment/PaymentExpressIPN.php +++ b/CRM/Core/Payment/PaymentExpressIPN.php @@ -145,7 +145,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { if ($contribution->invoice_id != $input['invoice']) { CRM_Core_Error::debug_log_message("Invoice values dont match between database and IPN request"); echo "Failure: Invoice values dont match between database and IPN request

"; - return; + return FALSE; } // lets replace invoice-id with Payment Processor -number because thats what is common and unique @@ -157,7 +157,7 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { if ($contribution->total_amount != $input['amount']) { CRM_Core_Error::debug_log_message("Amount values dont match between database and IPN request"); echo "Failure: Amount values dont match between database and IPN request. " . $contribution->total_amount . "/" . $input['amount'] . "

"; - return; + return FALSE; } $transaction = new CRM_Core_Transaction(); diff --git a/CRM/Core/Payment/ProcessorForm.php b/CRM/Core/Payment/ProcessorForm.php index 55ec6ffff4..6afebf6e53 100644 --- a/CRM/Core/Payment/ProcessorForm.php +++ b/CRM/Core/Payment/ProcessorForm.php @@ -26,6 +26,7 @@ */ use Civi\Payment\System; + /** * * @package CRM diff --git a/CRM/Core/Payment/eWAY.php b/CRM/Core/Payment/eWAY.php index 4975956980..68992819af 100644 --- a/CRM/Core/Payment/eWAY.php +++ b/CRM/Core/Payment/eWAY.php @@ -410,6 +410,7 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { return $params; } + // end function doDirectPayment /** diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index 5a3f0eff7a..d1ed8ea055 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -1449,7 +1449,8 @@ class CRM_Core_Permission { // Profile permissions $permissions['profile'] = [ - 'get' => [], // the profile will take care of this + // the profile will take care of this + 'get' => [], ]; $permissions['uf_group'] = [ diff --git a/CRM/Core/Permission/Backdrop.php b/CRM/Core/Permission/Backdrop.php index 9d4507c5a3..e2277df2f1 100644 --- a/CRM/Core/Permission/Backdrop.php +++ b/CRM/Core/Permission/Backdrop.php @@ -61,7 +61,6 @@ class CRM_Core_Permission_Backdrop extends CRM_Core_Permission_DrupalBase { protected $_viewPermissionedGroups; protected $_editPermissionedGroups; - /** * Given a permission string, check for access requirements * @@ -157,25 +156,25 @@ class CRM_Core_Permission_Backdrop extends CRM_Core_Permission_DrupalBase { // FIXME!!!! /** - $uids = array(); - $sql = " - SELECT {users}.uid, {role_permission}.permission - FROM {users} - JOIN {users_roles} - ON {users}.uid = {users_roles}.uid - JOIN {role_permission} - ON {role_permission}.rid = {users_roles}.rid - WHERE {role_permission}.permission = '{$permissionName}' - AND {users}.status = 1 - "; - - $result = db_query($sql); - foreach ($result as $record) { - $uids[] = $record->uid; - } - - $_cache[$permissionName] = self::getContactEmails($uids); - return $_cache[$permissionName]; + * $uids = array(); + * $sql = " + * SELECT {users}.uid, {role_permission}.permission + * FROM {users} + * JOIN {users_roles} + * ON {users}.uid = {users_roles}.uid + * JOIN {role_permission} + * ON {role_permission}.rid = {users_roles}.rid + * WHERE {role_permission}.permission = '{$permissionName}' + * AND {users}.status = 1 + * "; + * + * $result = db_query($sql); + * foreach ($result as $record) { + * $uids[] = $record->uid; + * } + * + * $_cache[$permissionName] = self::getContactEmails($uids); + * return $_cache[$permissionName]; */ return []; } diff --git a/CRM/Core/Permission/Base.php b/CRM/Core/Permission/Base.php index c14e63e3ae..d598e15cb3 100644 --- a/CRM/Core/Permission/Base.php +++ b/CRM/Core/Permission/Base.php @@ -38,7 +38,10 @@ */ class CRM_Core_Permission_Base { - // permission mapping to stub check() calls + /** + * permission mapping to stub check() calls + * @var array + */ public $permissions = NULL; /** diff --git a/CRM/Core/Permission/Drupal.php b/CRM/Core/Permission/Drupal.php index 4f67b6ce38..9c0bbdee78 100644 --- a/CRM/Core/Permission/Drupal.php +++ b/CRM/Core/Permission/Drupal.php @@ -61,7 +61,6 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase { protected $_viewPermissionedGroups; protected $_editPermissionedGroups; - /** * Given a permission string, check for access requirements * diff --git a/CRM/Core/Permission/Drupal8.php b/CRM/Core/Permission/Drupal8.php index 2b728bc477..dc2e4df215 100644 --- a/CRM/Core/Permission/Drupal8.php +++ b/CRM/Core/Permission/Drupal8.php @@ -37,6 +37,7 @@ * */ class CRM_Core_Permission_Drupal8 extends CRM_Core_Permission_DrupalBase { + /** * Given a permission string, check for access requirements * diff --git a/CRM/Core/Permission/Joomla.php b/CRM/Core/Permission/Joomla.php index 2eea7228a8..97c7a054c2 100644 --- a/CRM/Core/Permission/Joomla.php +++ b/CRM/Core/Permission/Joomla.php @@ -37,6 +37,7 @@ * */ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { + /** * Given a permission string, check for access requirements * @@ -74,7 +75,7 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { // This is a codeblock copied from /Civicrm/Utils/REST $uid = NULL; if (!$uid) { - $store = NULL; + $store = NULL; $contact_id = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $api_key, 'id', 'api_key'); @@ -180,9 +181,9 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { $query = $db->getQuery(TRUE); $query - ->select($db->quoteName('rules')) - ->from($db->quoteName('#__assets')) - ->where($db->quoteName('name') . ' = ' . $db->quote('com_civicrm')); + ->select($db->quoteName('rules')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote('com_civicrm')); $db->setQuery($query); @@ -204,9 +205,9 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { $query = $db->getQuery(TRUE); $query - ->update($db->quoteName('#__assets')) - ->set($db->quoteName('rules') . ' = ' . $db->quote(json_encode($associations))) - ->where($db->quoteName('name') . ' = ' . $db->quote('com_civicrm')); + ->update($db->quoteName('#__assets')) + ->set($db->quoteName('rules') . ' = ' . $db->quote(json_encode($associations))) + ->where($db->quoteName('name') . ' = ' . $db->quote('com_civicrm')); $db->setQuery($query)->execute(); } diff --git a/CRM/Core/Permission/Temp.php b/CRM/Core/Permission/Temp.php index 18740068a9..145e820832 100644 --- a/CRM/Core/Permission/Temp.php +++ b/CRM/Core/Permission/Temp.php @@ -41,7 +41,7 @@ * used when processing certain API backends. */ class CRM_Core_Permission_Temp { - static $id = 0; + public static $id = 0; /** * Array(int $grantId => array($perm)) diff --git a/CRM/Core/Permission/UnitTests.php b/CRM/Core/Permission/UnitTests.php index 66e5ad7e1e..0dccf48cdf 100644 --- a/CRM/Core/Permission/UnitTests.php +++ b/CRM/Core/Permission/UnitTests.php @@ -38,7 +38,10 @@ */ class CRM_Core_Permission_UnitTests extends CRM_Core_Permission_Base { - // permission mapping to stub check() calls + /** + * permission mapping to stub check() calls + * @var array + */ public $permissions = NULL; /** diff --git a/CRM/Core/Permission/WordPress.php b/CRM/Core/Permission/WordPress.php index dc5224f7f9..b58b059eb5 100644 --- a/CRM/Core/Permission/WordPress.php +++ b/CRM/Core/Permission/WordPress.php @@ -37,6 +37,7 @@ * */ class CRM_Core_Permission_WordPress extends CRM_Core_Permission_Base { + /** * Given a permission string, check for access requirements * diff --git a/CRM/Core/PrevNextCache/Sql.php b/CRM/Core/PrevNextCache/Sql.php index 51f767bee0..10fed3637e 100644 --- a/CRM/Core/PrevNextCache/Sql.php +++ b/CRM/Core/PrevNextCache/Sql.php @@ -34,7 +34,7 @@ class CRM_Core_PrevNextCache_Sql implements CRM_Core_PrevNextCache_Interface { /** * Store the results of a SQL query in the cache. - * + * @param string $cacheKey * @param string $sql * A SQL query. The query *MUST* be a SELECT statement which yields * the following columns (in order): cacheKey, entity_id1, data @@ -66,7 +66,7 @@ INSERT INTO civicrm_prevnext_cache (cacheKey, entity_id1, data) ->columns([ 'entity_id1', 'cacheKey', - 'data' + 'data', ]); foreach ($rows as &$row) { diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php index 96f9bba423..0af4bd1e10 100644 --- a/CRM/Core/PseudoConstant.php +++ b/CRM/Core/PseudoConstant.php @@ -54,10 +54,9 @@ class CRM_Core_PseudoConstant { private static $cache; /** - * @deprecated Please use the buildOptions() method in the appropriate BAO object. - * * activity type * @var array + * @deprecated Please use the buildOptions() method in the appropriate BAO object. */ private static $activityType; @@ -92,10 +91,9 @@ class CRM_Core_PseudoConstant { private static $countryIsoCode; /** - * @deprecated Please use the buildOptions() method in the appropriate BAO object. - * * group * @var array + * @deprecated Please use the buildOptions() method in the appropriate BAO object. */ private static $group; @@ -136,10 +134,9 @@ class CRM_Core_PseudoConstant { private static $worldRegions; /** - * @deprecated Please use the buildOptions() method in the appropriate BAO object. - * * activity status * @var array + * @deprecated Please use the buildOptions() method in the appropriate BAO object. */ private static $activityStatus; @@ -1524,7 +1521,6 @@ WHERE id = %1 return CRM_Extension_System::singleton()->getMapper()->getActiveModuleFiles($fresh); } - /** * Get all tax rates. * @@ -1551,7 +1547,7 @@ WHERE id = %1 else { $value[] = $option['values'][0]['value']; } - $where = 'AND efa.account_relationship IN (' . implode(', ', $value) . ' )'; + $where = 'AND efa.account_relationship IN (' . implode(', ', $value) . ' )'; } else { $where = ''; diff --git a/CRM/Core/QuickForm/Action/Display.php b/CRM/Core/QuickForm/Action/Display.php index 9118e2f2f3..53d012ae95 100644 --- a/CRM/Core/QuickForm/Action/Display.php +++ b/CRM/Core/QuickForm/Action/Display.php @@ -37,13 +37,13 @@ class CRM_Core_QuickForm_Action_Display extends CRM_Core_QuickForm_Action { * The template to display the required "red" asterick. * @var string */ - static $_requiredTemplate = NULL; + public static $_requiredTemplate = NULL; /** * The template to display error messages inline with the form element. * @var string */ - static $_errorTemplate = NULL; + public static $_errorTemplate = NULL; /** * Class constructor. diff --git a/CRM/Core/QuickForm/Action/Upload.php b/CRM/Core/QuickForm/Action/Upload.php index b684036a19..7f282ff36c 100644 --- a/CRM/Core/QuickForm/Action/Upload.php +++ b/CRM/Core/QuickForm/Action/Upload.php @@ -97,9 +97,9 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { $status = $element->moveUploadedFile($this->_uploadDir, $newName); if (!$status) { CRM_Core_Error::statusBounce(ts('We could not move the uploaded file %1 to the upload directory %2. Please verify that the \'Temporary Files\' setting points to a valid path which is writable by your web server.', [ - 1 => $value['name'], - 2 => $this->_uploadDir, - ])); + 1 => $value['name'], + 2 => $this->_uploadDir, + ])); } if (!empty($data['values'][$pageName][$uploadName]['name'])) { @unlink($this->_uploadDir . $data['values'][$pageName][$uploadName]); diff --git a/CRM/Core/QuickForm/GroupMultiSelect.php b/CRM/Core/QuickForm/GroupMultiSelect.php index 051ccda217..35a959ad94 100644 --- a/CRM/Core/QuickForm/GroupMultiSelect.php +++ b/CRM/Core/QuickForm/GroupMultiSelect.php @@ -34,6 +34,7 @@ * */ class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMultiSelect { + /** * Returns the HTML generated for the advanced multiple select component. * diff --git a/CRM/Core/QuickForm/NestedAdvMultiSelect.php b/CRM/Core/QuickForm/NestedAdvMultiSelect.php index 84a787a1c6..791ef9ef24 100644 --- a/CRM/Core/QuickForm/NestedAdvMultiSelect.php +++ b/CRM/Core/QuickForm/NestedAdvMultiSelect.php @@ -40,6 +40,7 @@ require_once 'HTML/QuickForm/advmultiselect.php'; * Class CRM_Core_QuickForm_NestedAdvMultiSelect */ class CRM_Core_QuickForm_NestedAdvMultiSelect extends HTML_QuickForm_advmultiselect { + /** * Loads options from different types of data sources. * diff --git a/CRM/Core/Reference/Interface.php b/CRM/Core/Reference/Interface.php index 09e0a0ba6d..f1bcaff6d2 100644 --- a/CRM/Core/Reference/Interface.php +++ b/CRM/Core/Reference/Interface.php @@ -4,6 +4,7 @@ * Interface CRM_Core_Reference_Interface */ interface CRM_Core_Reference_Interface { + public function getReferenceTable(); public function getReferenceKey(); diff --git a/CRM/Core/Region.php b/CRM/Core/Region.php index 6ea85bc07a..a9f9e13b71 100644 --- a/CRM/Core/Region.php +++ b/CRM/Core/Region.php @@ -26,21 +26,21 @@ class CRM_Core_Region { * * @var string */ - var $_name; + public $_name; /** * List of snippets to inject within region * * @var array; e.g. $this->_snippets[3]['type'] = 'template'; */ - var $_snippets; + public $_snippets; /** * Whether the snippets array has been sorted * * @var boolean */ - var $_isSorted; + public $_isSorted; /** * @param string $name diff --git a/CRM/Core/Resources.php b/CRM/Core/Resources.php index c65d0330eb..014750ece7 100644 --- a/CRM/Core/Resources.php +++ b/CRM/Core/Resources.php @@ -111,7 +111,7 @@ class CRM_Core_Resources { * New copy of the manager. * @return CRM_Core_Resources */ - static public function singleton(CRM_Core_Resources $instance = NULL) { + public static function singleton(CRM_Core_Resources $instance = NULL) { if ($instance !== NULL) { self::$_singleton = $instance; } @@ -207,12 +207,12 @@ class CRM_Core_Resources { */ public function addScriptUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) { CRM_Core_Region::instance($region)->add([ - 'name' => $url, - 'type' => 'scriptUrl', - 'scriptUrl' => $url, - 'weight' => $weight, - 'region' => $region, - ]); + 'name' => $url, + 'type' => 'scriptUrl', + 'scriptUrl' => $url, + 'weight' => $weight, + 'region' => $region, + ]); return $this; } @@ -230,11 +230,11 @@ class CRM_Core_Resources { public function addScript($code, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) { CRM_Core_Region::instance($region)->add([ // 'name' => automatic - 'type' => 'script', - 'script' => $code, - 'weight' => $weight, - 'region' => $region, - ]); + 'type' => 'script', + 'script' => $code, + 'weight' => $weight, + 'region' => $region, + ]); return $this; } @@ -423,12 +423,12 @@ class CRM_Core_Resources { */ public function addStyleUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) { CRM_Core_Region::instance($region)->add([ - 'name' => $url, - 'type' => 'styleUrl', - 'styleUrl' => $url, - 'weight' => $weight, - 'region' => $region, - ]); + 'name' => $url, + 'type' => 'styleUrl', + 'styleUrl' => $url, + 'weight' => $weight, + 'region' => $region, + ]); return $this; } @@ -446,11 +446,11 @@ class CRM_Core_Resources { public function addStyle($code, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) { CRM_Core_Region::instance($region)->add([ // 'name' => automatic - 'type' => 'style', - 'style' => $code, - 'weight' => $weight, - 'region' => $region, - ]); + 'type' => 'style', + 'style' => $code, + 'weight' => $weight, + 'region' => $region, + ]); return $this; } @@ -535,7 +535,8 @@ class CRM_Core_Resources { $files = array_merge($files, (array) glob("$path/$pattern", $flags)); } } - sort($files); // Deterministic order. + // Deterministic order. + sort($files); $files = array_unique($files); return array_map(function ($file) use ($path) { return CRM_Utils_File::relativize($file, "$path/"); @@ -813,10 +814,10 @@ class CRM_Core_Resources { */ public static function isAjaxMode() { if (in_array(CRM_Utils_Array::value('snippet', $_REQUEST), [ - CRM_Core_Smarty::PRINT_SNIPPET, - CRM_Core_Smarty::PRINT_NOFORM, - CRM_Core_Smarty::PRINT_JSON, - ]) + CRM_Core_Smarty::PRINT_SNIPPET, + CRM_Core_Smarty::PRINT_NOFORM, + CRM_Core_Smarty::PRINT_JSON, + ]) ) { return TRUE; } @@ -825,7 +826,7 @@ class CRM_Core_Resources { } /** - * @param GenericHookEvent $e + * @param \Civi\Core\Event\GenericHookEvent $e * @see \CRM_Utils_Hook::buildAsset() */ public static function renderMenubarStylesheet(GenericHookEvent $e) { diff --git a/CRM/Core/Resources/Strings.php b/CRM/Core/Resources/Strings.php index 4f1315c468..451d02dda2 100644 --- a/CRM/Core/Resources/Strings.php +++ b/CRM/Core/Resources/Strings.php @@ -67,7 +67,8 @@ class CRM_Core_Resources_Strings { * List of translatable strings. */ public function get($bucket, $file, $format) { - $stringsByFile = $this->cache->get($bucket); // array($file => array(...strings...)) + // array($file => array(...strings...)) + $stringsByFile = $this->cache->get($bucket); if (!$stringsByFile) { $stringsByFile = []; } diff --git a/CRM/Core/ScheduledJob.php b/CRM/Core/ScheduledJob.php index eb2be0bf13..87ec71d94f 100644 --- a/CRM/Core/ScheduledJob.php +++ b/CRM/Core/ScheduledJob.php @@ -36,13 +36,13 @@ */ class CRM_Core_ScheduledJob { - var $version = 3; + public $version = 3; - var $name = NULL; + public $name = NULL; - var $apiParams = []; + public $apiParams = []; - var $remarks = []; + public $remarks = []; /** * @param array $params diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 87dd9c37eb..18af287821 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -306,7 +306,7 @@ class CRM_Core_SelectValues { * date format (QF format) * @param null $minOffset * @param null $maxOffset - * + * @param string $context * @return array * the date array */ @@ -933,7 +933,6 @@ class CRM_Core_SelectValues { return $profileGroupType; } - /** * Word replacement match type. * diff --git a/CRM/Core/Selector/Controller.php b/CRM/Core/Selector/Controller.php index 30a9225b9b..a64a7eabeb 100644 --- a/CRM/Core/Selector/Controller.php +++ b/CRM/Core/Selector/Controller.php @@ -104,6 +104,7 @@ class CRM_Core_Selector_Controller { /** * The objectAction for the WebObject + * @var int */ protected $_action; diff --git a/CRM/Core/Session.php b/CRM/Core/Session.php index c9d10d2b3a..8aa67bf9ca 100644 --- a/CRM/Core/Session.php +++ b/CRM/Core/Session.php @@ -32,8 +32,9 @@ class CRM_Core_Session { /** * Cache of all the session names that we manage. + * @var array */ - static $_managedNames = NULL; + public static $_managedNames = NULL; /** * Key is used to allow the application to have multiple top diff --git a/CRM/Core/ShowHideBlocks.php b/CRM/Core/ShowHideBlocks.php index ba2edef206..ca66329ca8 100644 --- a/CRM/Core/ShowHideBlocks.php +++ b/CRM/Core/ShowHideBlocks.php @@ -37,7 +37,8 @@ class CRM_Core_ShowHideBlocks { * * @var string */ - static $_showIcon, $_hideIcon; + public static $_showIcon; + public static $_hideIcon; /** * The array of ids of blocks that will be shown. diff --git a/CRM/Core/Smarty/Permissions.php b/CRM/Core/Smarty/Permissions.php index 9e2f35b006..47229be394 100644 --- a/CRM/Core/Smarty/Permissions.php +++ b/CRM/Core/Smarty/Permissions.php @@ -4,6 +4,7 @@ * Class CRM_Core_Smarty_Permissions */ class CRM_Core_Smarty_Permissions { + /** * non-static adapter for CRM_Core_Permission::check * @param $offset diff --git a/CRM/Core/Smarty/plugins/function.crmAPI.php b/CRM/Core/Smarty/plugins/function.crmAPI.php index 7c4db31393..38fd038928 100644 --- a/CRM/Core/Smarty/plugins/function.crmAPI.php +++ b/CRM/Core/Smarty/plugins/function.crmAPI.php @@ -55,7 +55,6 @@ function smarty_function_crmAPI($params, &$smarty) { unset($errorScope); if ($result === FALSE) { $smarty->trigger_error("Unknown error"); - return; } if (!empty($result['is_error'])) { diff --git a/CRM/Core/Smarty/plugins/function.crmKey.php b/CRM/Core/Smarty/plugins/function.crmKey.php index a9ed3f2c80..72bb841749 100644 --- a/CRM/Core/Smarty/plugins/function.crmKey.php +++ b/CRM/Core/Smarty/plugins/function.crmKey.php @@ -45,8 +45,7 @@ * the generated key */ function smarty_function_crmKey($params, &$smarty) { - return - CRM_Core_Key::get( + return CRM_Core_Key::get( $params['name'], CRM_Utils_Array::value('addSequence', $params, 0) ); diff --git a/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php b/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php index b45e5f85f7..cb3ecf363a 100644 --- a/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php +++ b/CRM/Core/Smarty/plugins/function.simpleActivityContacts.php @@ -51,15 +51,15 @@ function smarty_function_simpleActivityContacts($params, &$smarty) { } foreach ([ - 'target', - 'assignee', - ] as $role) { + 'target', + 'assignee', + ] as $role) { $contact = []; if (!empty($activity[$role . '_contact_id'])) { $contact_id = array_shift($activity[$role . '_contact_id']); $contact = civicrm_api('contact', 'getsingle', $baseContactParams + [ - 'contact_id' => $contact_id, - ]); + 'contact_id' => $contact_id, + ]); } $smarty->assign($params[$role . '_var'], $contact); } diff --git a/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php b/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php index 88bb6382c0..c9c35ec466 100644 --- a/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php +++ b/CRM/Core/Smarty/plugins/prefilter.resetExtScope.php @@ -8,8 +8,7 @@ * @return string */ function smarty_prefilter_resetExtScope($tpl_source, &$smarty) { - return - '{crmScope extensionKey=""}' + return '{crmScope extensionKey=""}' . $tpl_source . '{/crmScope}'; } diff --git a/CRM/Core/Smarty/resources/String.php b/CRM/Core/Smarty/resources/String.php index 0ac2ad8dca..11241937d4 100644 --- a/CRM/Core/Smarty/resources/String.php +++ b/CRM/Core/Smarty/resources/String.php @@ -75,10 +75,9 @@ function civicrm_smarty_resource_string_get_trusted($tpl_name, &$smarty_obj) { function civicrm_smarty_register_string_resource() { $template = CRM_Core_Smarty::singleton(); $template->register_resource('string', [ - 'civicrm_smarty_resource_string_get_template', - 'civicrm_smarty_resource_string_get_timestamp', - 'civicrm_smarty_resource_string_get_secure', - 'civicrm_smarty_resource_string_get_trusted', - ] - ); + 'civicrm_smarty_resource_string_get_template', + 'civicrm_smarty_resource_string_get_timestamp', + 'civicrm_smarty_resource_string_get_secure', + 'civicrm_smarty_resource_string_get_trusted', + ]); } diff --git a/CRM/Core/TableHierarchy.php b/CRM/Core/TableHierarchy.php index 05037234e0..49a0955554 100644 --- a/CRM/Core/TableHierarchy.php +++ b/CRM/Core/TableHierarchy.php @@ -39,7 +39,7 @@ class CRM_Core_TableHierarchy { * This array defines weights for table, which are used to sort array of table in from clause * @var array */ - static $info = [ + public static $info = [ 'civicrm_contact' => '01', 'civicrm_address' => '09', 'civicrm_county' => '10', diff --git a/CRM/Core/Task.php b/CRM/Core/Task.php index 1ecace6833..96724ea89f 100644 --- a/CRM/Core/Task.php +++ b/CRM/Core/Task.php @@ -70,7 +70,7 @@ abstract class CRM_Core_Task { * This must be defined in each child class. It is passed to the searchTasks hook. * Example: $objectType = 'event'; */ - static $objectType = NULL; + public static $objectType = NULL; /** * Generates a list of batch tasks available for the current entities. diff --git a/CRM/Core/TemporaryErrorScope.php b/CRM/Core/TemporaryErrorScope.php index 0aefdbf63d..d8853b8ef8 100644 --- a/CRM/Core/TemporaryErrorScope.php +++ b/CRM/Core/TemporaryErrorScope.php @@ -22,7 +22,7 @@ * safe to temporarily switch to exception */ class CRM_Core_TemporaryErrorScope { - static $oldFrames; + public static $oldFrames; /** * @return CRM_Core_TemporaryErrorScope diff --git a/CRM/Core/Transaction.php b/CRM/Core/Transaction.php index a61fbf4611..e23e9f4315 100644 --- a/CRM/Core/Transaction.php +++ b/CRM/Core/Transaction.php @@ -95,6 +95,7 @@ class CRM_Core_Transaction { /** * Whether commit() has been called on this instance * of CRM_Core_Transaction + * @var bool */ private $_pseudoCommitted = FALSE; @@ -147,7 +148,7 @@ class CRM_Core_Transaction { /** * @param $flag */ - static public function rollbackIfFalse($flag) { + public static function rollbackIfFalse($flag) { $frame = \Civi\Core\Transaction\Manager::singleton()->getFrame(); if ($flag === FALSE && $frame !== NULL) { $frame->setRollbackOnly(); @@ -203,7 +204,7 @@ class CRM_Core_Transaction { * callstack will not wind-down normally -- e.g. before * a call to exit(). */ - static public function forceRollbackIfEnabled() { + public static function forceRollbackIfEnabled() { if (\Civi\Core\Transaction\Manager::singleton()->getFrame() !== NULL) { \Civi\Core\Transaction\Manager::singleton()->forceRollback(); } @@ -212,7 +213,7 @@ class CRM_Core_Transaction { /** * @return bool */ - static public function willCommit() { + public static function willCommit() { $frame = \Civi\Core\Transaction\Manager::singleton()->getFrame(); return ($frame === NULL) ? TRUE : !$frame->isRollbackOnly(); } @@ -220,7 +221,7 @@ class CRM_Core_Transaction { /** * Determine whether there is a pending transaction. */ - static public function isActive() { + public static function isActive() { $frame = \Civi\Core\Transaction\Manager::singleton()->getFrame(); return ($frame !== NULL); } @@ -246,7 +247,7 @@ class CRM_Core_Transaction { * See php manual call_user_func_array for details. * @param int $id */ - static public function addCallback($phase, $callback, $params = NULL, $id = NULL) { + public static function addCallback($phase, $callback, $params = NULL, $id = NULL) { $frame = \Civi\Core\Transaction\Manager::singleton()->getBaseFrame(); $frame->addCallback($phase, $callback, $params, $id); } diff --git a/CRM/Custom/Form/ChangeFieldType.php b/CRM/Custom/Form/ChangeFieldType.php index 89aa390a18..7e89f12382 100644 --- a/CRM/Custom/Form/ChangeFieldType.php +++ b/CRM/Custom/Form/ChangeFieldType.php @@ -47,11 +47,13 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form { /** * Array of custom field values + * @var array */ protected $_values; /** * Mapper array of valid field type + * @var array */ protected $_htmlTypeTransitions; @@ -118,18 +120,17 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form { ); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Change Field Type'), - 'isDefault' => TRUE, - 'js' => ['onclick' => 'return checkCustomDataField();'], - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Change Field Type'), + 'isDefault' => TRUE, + 'js' => ['onclick' => 'return checkCustomDataField();'], + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** @@ -165,23 +166,20 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form { $customField->find(TRUE); if ($dstHtmlType == 'Text' && in_array($srcHtmlType, [ - 'Select', - 'Radio', - 'Autocomplete-Select', - ]) - ) { + 'Select', + 'Radio', + 'Autocomplete-Select', + ])) { $customField->option_group_id = "NULL"; CRM_Core_BAO_CustomField::checkOptionGroup($this->_values['option_group_id']); } if (in_array($srcHtmlType, $mutliValueOps) && - in_array($dstHtmlType, $singleValueOps) - ) { + in_array($dstHtmlType, $singleValueOps)) { $this->flattenToFirstValue($tableName, $this->_values['column_name']); } elseif (in_array($srcHtmlType, $singleValueOps) && - in_array($dstHtmlType, $mutliValueOps) - ) { + in_array($dstHtmlType, $mutliValueOps)) { $this->firstValueToFlatten($tableName, $this->_values['column_name']); } diff --git a/CRM/Custom/Form/DeleteField.php b/CRM/Custom/Form/DeleteField.php index f196a29b9f..364f44fe9d 100644 --- a/CRM/Custom/Form/DeleteField.php +++ b/CRM/Custom/Form/DeleteField.php @@ -78,17 +78,16 @@ class CRM_Custom_Form_DeleteField extends CRM_Core_Form { public function buildQuickForm() { $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Delete Custom Field'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Delete Custom Field'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Custom/Form/DeleteGroup.php b/CRM/Custom/Form/DeleteGroup.php index 4c6af1a9a4..fa7f356c0f 100644 --- a/CRM/Custom/Form/DeleteGroup.php +++ b/CRM/Custom/Form/DeleteGroup.php @@ -89,17 +89,16 @@ class CRM_Custom_Form_DeleteGroup extends CRM_Core_Form { public function buildQuickForm() { $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Delete Custom Group'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Delete Custom Group'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } /** diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php index f9e25de480..14d407950a 100644 --- a/CRM/Custom/Form/Field.php +++ b/CRM/Custom/Form/Field.php @@ -66,6 +66,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { /** * Array of custom field values if update mode. + * @var array */ protected $_values; @@ -483,7 +484,8 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { $this->add('number', 'note_length', ts('Maximum length') . ' ', - $attributes['text_length'], // note_length is an alias for the text-length field + // note_length is an alias for the text-length field + $attributes['text_length'], FALSE ); @@ -540,22 +542,21 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { // add buttons $this->addButtons([ - [ - 'type' => 'done', - 'name' => ts('Save'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'next', - 'name' => ts('Save and New'), - 'subName' => 'new', - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'done', + 'name' => ts('Save'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'next', + 'name' => ts('Save and New'), + 'subName' => 'new', + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); // add a form rule to check default value $this->addFormRule(['CRM_Custom_Form_Field', 'formRule'], $this); @@ -595,7 +596,8 @@ class CRM_Custom_Form_Field extends CRM_Core_Form { //validate field label as well as name. $title = $fields['label']; $name = CRM_Utils_String::munge($title, '_', 64); - $gId = $self->_gid; // CRM-7564 + // CRM-7564 + $gId = $self->_gid; $query = 'select count(*) from civicrm_custom_field where ( name like %1 OR label like %2 ) and id != %3 and custom_group_id = %4'; $fldCnt = CRM_Core_DAO::singleValueQuery($query, [ 1 => [$name, 'String'], diff --git a/CRM/Custom/Form/MoveField.php b/CRM/Custom/Form/MoveField.php index d05af627a3..f52a549fc0 100644 --- a/CRM/Custom/Form/MoveField.php +++ b/CRM/Custom/Form/MoveField.php @@ -126,17 +126,16 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form { ); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Move Custom Field'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Move Custom Field'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); $this->addFormRule(['CRM_Custom_Form_MoveField', 'formRule'], $this); } diff --git a/CRM/Custom/Form/Option.php b/CRM/Custom/Form/Option.php index 96d8a42058..34b02bd2bc 100644 --- a/CRM/Custom/Form/Option.php +++ b/CRM/Custom/Form/Option.php @@ -54,6 +54,7 @@ class CRM_Custom_Form_Option extends CRM_Core_Form { /** * The option group ID + * @var int */ protected $_optionGroupID = NULL; @@ -153,17 +154,16 @@ class CRM_Custom_Form_Option extends CRM_Core_Form { $option = civicrm_api3('option_value', 'getsingle', ['id' => $this->_id]); $this->assign('label', $option['label']); $this->addButtons([ - [ - 'type' => 'next', - 'name' => ts('Delete'), - 'isDefault' => TRUE, - ], - [ - 'type' => 'cancel', - 'name' => ts('Cancel'), - ], - ] - ); + [ + 'type' => 'next', + 'name' => ts('Delete'), + 'isDefault' => TRUE, + ], + [ + 'type' => 'cancel', + 'name' => ts('Cancel'), + ], + ]); } else { // lets trim all the whitespace @@ -196,22 +196,21 @@ class CRM_Custom_Form_Option extends CRM_Core_Form { // add buttons $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'), + ], + ]); // if view mode pls freeze it with the done button. if ($this->_action & CRM_Core_Action::VIEW) { diff --git a/CRM/Custom/Form/Preview.php b/CRM/Custom/Form/Preview.php index 4ad064eaf5..9f7c9e06a7 100644 --- a/CRM/Custom/Form/Preview.php +++ b/CRM/Custom/Form/Preview.php @@ -118,13 +118,12 @@ class CRM_Custom_Form_Preview extends CRM_Core_Form { $this->assign('groupTree', $this->_groupTree); } $this->addButtons([ - [ - 'type' => 'cancel', - 'name' => ts('Done with Preview'), - 'isDefault' => TRUE, - ], - ] - ); + [ + 'type' => 'cancel', + 'name' => ts('Done with Preview'), + 'isDefault' => TRUE, + ], + ]); } } diff --git a/CRM/Custom/Import/Controller.php b/CRM/Custom/Import/Controller.php index 375991f3f7..c67e399031 100644 --- a/CRM/Custom/Import/Controller.php +++ b/CRM/Custom/Import/Controller.php @@ -4,6 +4,7 @@ * Class CRM_Custom_Import_Controller */ class CRM_Custom_Import_Controller extends CRM_Core_Controller { + /** * Class constructor. * diff --git a/CRM/Custom/Import/Form/Summary.php b/CRM/Custom/Import/Form/Summary.php index 228465fa21..716e59f1f9 100644 --- a/CRM/Custom/Import/Form/Summary.php +++ b/CRM/Custom/Import/Form/Summary.php @@ -4,6 +4,7 @@ * Class CRM_Custom_Import_Form_Summary */ class CRM_Custom_Import_Form_Summary extends CRM_Contact_Import_Form_Summary { + /** * Set variables up before form is built. * diff --git a/CRM/Custom/Import/Parser.php b/CRM/Custom/Import/Parser.php index 7d8fb5e2ac..0832d00bac 100644 --- a/CRM/Custom/Import/Parser.php +++ b/CRM/Custom/Import/Parser.php @@ -36,22 +36,26 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser { protected $_fileName; - /**#@+ + /** + * #@+ * @var integer */ /** * Imported file size + * @var int */ protected $_fileSize; /** * Separator being used + * @var string */ protected $_separator; /** * Total number of lines in file + * @var int */ protected $_lineCount; @@ -252,31 +256,25 @@ abstract class CRM_Custom_Import_Parser extends CRM_Contact_Import_Parser { if ($this->_invalidRowCount) { // removed view url for invlaid contacts $headers = array_merge([ - ts('Line Number'), - ts('Reason'), - ], - $customHeaders - ); + ts('Line Number'), + ts('Reason'), + ], $customHeaders); $this->_errorFileName = self::errorFileName(self::ERROR); self::exportCSV($this->_errorFileName, $headers, $this->_errors); } if ($this->_conflictCount) { $headers = array_merge([ - ts('Line Number'), - ts('Reason'), - ], - $customHeaders - ); + ts('Line Number'), + ts('Reason'), + ], $customHeaders); $this->_conflictFileName = self::errorFileName(self::CONFLICT); self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts); } if ($this->_duplicateCount) { $headers = array_merge([ - ts('Line Number'), - ts('View Activity History URL'), - ], - $customHeaders - ); + ts('Line Number'), + ts('View Activity History URL'), + ], $customHeaders); $this->_duplicateFileName = self::errorFileName(self::DUPLICATE); self::exportCSV($this->_duplicateFileName, $headers, $this->_duplicates); diff --git a/CRM/Custom/Import/Parser/Api.php b/CRM/Custom/Import/Parser/Api.php index 13f0c2db89..ab60fa1d33 100644 --- a/CRM/Custom/Import/Parser/Api.php +++ b/CRM/Custom/Import/Parser/Api.php @@ -33,10 +33,10 @@ class CRM_Custom_Import_Parser_Api extends CRM_Custom_Import_Parser { $customGroupID = $this->_multipleCustomData; $importableFields = $this->getGroupFieldsForImport($customGroupID, $this); $this->_fields = array_merge([ - 'do_not_import' => ['title' => ts('- do not import -')], - 'contact_id' => ['title' => ts('Contact ID')], - 'external_identifier' => ['title' => ts('External Identifier')], - ], $importableFields); + 'do_not_import' => ['title' => ts('- do not import -')], + 'contact_id' => ['title' => ts('Contact ID')], + 'external_identifier' => ['title' => ts('External Identifier')], + ], $importableFields); } /** diff --git a/CRM/Dedupe/BAO/QueryBuilder.php b/CRM/Dedupe/BAO/QueryBuilder.php index 3daff16951..1137be40c9 100644 --- a/CRM/Dedupe/BAO/QueryBuilder.php +++ b/CRM/Dedupe/BAO/QueryBuilder.php @@ -3,6 +3,7 @@ * Class CRM_Dedupe_BAO_QueryBuilder */ class CRM_Dedupe_BAO_QueryBuilder { + /** * @param $rg * @param string $strID1 diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php index 5f9aa38dce..373866f7a8 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php @@ -5,6 +5,7 @@ * Class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral */ class CRM_Dedupe_BAO_QueryBuilder_IndividualGeneral extends CRM_Dedupe_BAO_QueryBuilder { + /** * @param $rg * diff --git a/CRM/Dedupe/BAO/Rule.php b/CRM/Dedupe/BAO/Rule.php index 67ce966cb6..ed0cdb6bc0 100644 --- a/CRM/Dedupe/BAO/Rule.php +++ b/CRM/Dedupe/BAO/Rule.php @@ -41,13 +41,15 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { /** * Ids of the contacts to limit the SQL queries (whole-database queries otherwise) + * @var array */ - var $contactIds = []; + public $contactIds = []; /** * Params to dedupe against (queries against the whole contact set otherwise) + * @var array */ - var $params = []; + public $params = []; /** * Return the SQL query for the given rule - either for finding matching @@ -78,7 +80,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule { $innerJoinClauses = [ "t1.{$this->rule_field} IS NOT NULL", "t2.{$this->rule_field} IS NOT NULL", - "t1.{$this->rule_field} = t2.{$this->rule_field}" + "t1.{$this->rule_field} = t2.{$this->rule_field}", ]; if ($fields[$this->rule_field]['type'] === CRM_Utils_Type::T_DATE) { $innerJoinClauses[] = "t1.{$this->rule_field} > '1000-01-01'"; diff --git a/CRM/Dedupe/BAO/RuleGroup.php b/CRM/Dedupe/BAO/RuleGroup.php index f1bfd1478b..b6dab2843a 100644 --- a/CRM/Dedupe/BAO/RuleGroup.php +++ b/CRM/Dedupe/BAO/RuleGroup.php @@ -41,8 +41,9 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { /** * Ids of the contacts to limit the SQL queries (whole-database queries otherwise) + * @var array */ - var $contactIds = []; + public $contactIds = []; /** * Set the contact IDs to restrict the dedupe to. @@ -55,13 +56,15 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { /** * Params to dedupe against (queries against the whole contact set otherwise) + * @var array */ - var $params = []; + public $params = []; /** * If there are no rules in rule group. + * @var bool */ - var $noRules = FALSE; + public $noRules = FALSE; protected $temporaryTables = []; @@ -497,7 +500,6 @@ class CRM_Dedupe_BAO_RuleGroup extends CRM_Dedupe_DAO_RuleGroup { return $result; } - /** * Get the cached contact type for a particular rule group. * diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php index 4926760db0..7b6c936e72 100644 --- a/CRM/Dedupe/Finder.php +++ b/CRM/Dedupe/Finder.php @@ -331,7 +331,7 @@ class CRM_Dedupe_Finder { * @param array $foundDupes * @param string $cacheKeyString * - * @return array Dupe pairs with the keys + * @return array * Dupe pairs with the keys * -srcID * -srcName diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 3cab5581bb..ceea27b4e8 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -468,10 +468,9 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $membershipIDs = CRM_Utils_Array::collect('id', CRM_Utils_Array::value('values', civicrm_api3("Membership", "get", [ - "contact_id" => $otherID, - "return" => "id", - ] - ) + "contact_id" => $otherID, + "return" => "id", + ]) ) ); @@ -817,15 +816,15 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $msg = ''; if (!empty($stats['merged'])) { $msg = '

' . ts('One contact merged.', [ - 'count' => $stats['merged'], - 'plural' => '%count contacts merged.', - ]) . '

'; + 'count' => $stats['merged'], + 'plural' => '%count contacts merged.', + ]) . '

'; } if (!empty($stats['skipped'])) { $msg .= '

' . ts('One contact was skipped.', [ - 'count' => $stats['skipped'], - 'plural' => '%count contacts were skipped.', - ]) . '

'; + 'count' => $stats['skipped'], + 'plural' => '%count contacts were skipped.', + ]) . '

'; } return $msg; } @@ -1039,7 +1038,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * * @return bool */ - static public function locationIsSame($mainAddress, $comparisonAddress) { + public static function locationIsSame($mainAddress, $comparisonAddress) { $keysToIgnore = [ 'id', 'is_primary', @@ -2037,7 +2036,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m ]; $activity = civicrm_api3('activity', 'create', [ 'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() : - $mainId, + $mainId, 'subject' => ts('Contact ID %1 has been merged and deleted.', $params), 'target_contact_id' => $mainId, 'activity_type_id' => 'Contact Merged', @@ -2049,7 +2048,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m ])) { civicrm_api3('activity', 'create', [ 'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() : - $otherId, + $otherId, 'subject' => ts('Contact ID %1 has been merged into Contact ID %2 and deleted.', $params), 'target_contact_id' => $otherId, 'activity_type_id' => 'Contact Deleted by Merge', @@ -2081,7 +2080,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * Limit to searching for matches against this many contacts. * * @return array - * Array of matches meeting the criteria. + * Array of matches meeting the criteria. */ public static function getDuplicatePairs($rule_group_id, $group_id, $reloadCacheIfEmpty, $batchLimit, $isSelected, $orderByClause = '', $includeConflicts = TRUE, $criteria = [], $checkPermissions = TRUE, $searchLimit = 0) { $where = self::getWhereString($isSelected); -- 2.25.1