Skip to content

Commit

Permalink
Merge pull request civicrm#14023 from seamuslee001/core_dedupe_custom
Browse files Browse the repository at this point in the history
(NFC) Update CRM/Core CRM/Custom CRM/Dedupe to match the new coder style
  • Loading branch information
colemanw authored Apr 10, 2019
2 parents 3265343 + 518fa0e commit 401bf6e
Show file tree
Hide file tree
Showing 145 changed files with 752 additions and 646 deletions.
6 changes: 3 additions & 3 deletions CRM/Core/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion CRM/Core/BAO/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
3 changes: 2 additions & 1 deletion CRM/Core/BAO/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -359,6 +359,7 @@ protected static function pickSessionTtl($sessionKey) {
* @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
Expand Down
12 changes: 6 additions & 6 deletions CRM/Core/BAO/CustomGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ protected static function validateSubTypeByEntity($entityType, $subType) {
* @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);
Expand All @@ -736,7 +736,7 @@ static private function whereListHas($column, $value, $delimiter = CRM_Core_DAO:
* @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
Expand Down Expand Up @@ -765,7 +765,7 @@ static public function customGroupDataExistsForEntity($entityID, $table, $getCou
* @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) {
Expand Down Expand Up @@ -796,7 +796,7 @@ static public function buildEntityTreeSingleFields(&$groupTree, $entityID, $enti
* @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 = "
Expand Down Expand Up @@ -827,7 +827,7 @@ static public function buildEntityTreeMultipleFields(&$groupTree, $entityID, $en
* @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) {
Expand Down Expand Up @@ -864,7 +864,7 @@ static public function buildTreeEntityDataFromQuery(&$groupTree, $query, $includ
* @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}";
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/CustomOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static function getCustomOption(
* -rp = rowcount
* -page= offset
*/
static public function getOptionListSelector(&$params) {
public static function getOptionListSelector(&$params) {
$options = [];

$field = CRM_Core_BAO_CustomField::getFieldObject($params['fid']);
Expand Down
4 changes: 2 additions & 2 deletions CRM/Core/BAO/CustomQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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',
Expand Down
1 change: 0 additions & 1 deletion CRM/Core/BAO/CustomValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public static function typeToField($type) {
}
}


/**
* @param array $formValues
* @return null
Expand Down
3 changes: 2 additions & 1 deletion CRM/Core/BAO/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* Class contains Contact dashboard related functions.
*/
class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard {

/**
* Add Dashboard.
*
Expand Down Expand Up @@ -175,7 +176,7 @@ public static function getContactDashletsForJS() {
* the default dashlets.
*
* @return array
* Array of dashboard_id's
* Array of dashboard_id's
* @throws \CiviCRM_API3_Exception
*/
public static function initializeDashlets() {
Expand Down
6 changes: 4 additions & 2 deletions CRM/Core/BAO/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -164,7 +166,7 @@ public static function multipleDomains() {

/**
* @param bool $skipFatal
*
* @param bool $returnString
* @return array
* name & email for domain
* @throws Exception
Expand Down
6 changes: 3 additions & 3 deletions CRM/Core/BAO/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -95,7 +95,6 @@ public static function path($fileID, $entityID) {
return [NULL, NULL];
}


/**
* @param $data
* @param int $fileTypeID
Expand Down Expand Up @@ -695,7 +694,6 @@ public static function deleteAttachment() {
self::deleteEntityFile($params['entityTable'], $params['entityID'], NULL, $params['fileID']);
}


/**
* Display paper icon for a file attachment -- CRM-13624
*
Expand Down Expand Up @@ -772,6 +770,8 @@ public static function getSearchService() {
*
* @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) {
Expand Down
2 changes: 2 additions & 0 deletions CRM/Core/BAO/FinancialTrxn.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn {
*
* @return \CRM_Financial_DAO_FinancialTrxn
*/

/**
*/
public function __construct() {
Expand Down Expand Up @@ -139,6 +140,7 @@ public static function retrieve(&$params, &$defaults) {
* @param bool $newTrxn
* @param string $whereClause
* Additional where parameters
* @param int $fromAccountID
*
* @return array
* array of category id's the contact belongs to.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static function cleanup($maxEntriesToKeep = 1000, $minDaysToKeep = 30) {
* 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 = []) {
Expand Down
8 changes: 5 additions & 3 deletions CRM/Core/BAO/LabelFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down Expand Up @@ -258,7 +260,7 @@ private static function _getGid($name = 'label_format') {
/**
* 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.
*
Expand Down Expand Up @@ -382,7 +384,7 @@ public static function &getById($id, $groupName = 'label_format') {
*
* @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
Expand Down Expand Up @@ -458,7 +460,7 @@ public static function customGroupName() {
/**
* 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
Expand Down
25 changes: 13 additions & 12 deletions CRM/Core/BAO/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -109,11 +110,11 @@ public static function createLocBlock(&$location, &$entityElements) {
}

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;
}
Expand Down Expand Up @@ -367,12 +368,12 @@ public static function checkPrimaryBlocks($contactId) {
$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])
Expand Down
5 changes: 3 additions & 2 deletions CRM/Core/BAO/LocationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions CRM/Core/BAO/Mapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,10 @@ public static function buildMappingForm(&$form, $mappingType, $mappingId, $colum
//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]);
Expand Down Expand Up @@ -983,7 +983,6 @@ public function getRelationTypeCustomGroupData($relationshipTypeId) {
return $groupTitle;
}


/**
* Function returns all Custom group Names.
*
Expand Down
Loading

0 comments on commit 401bf6e

Please sign in to comment.