From: Kurund Jalmi Date: Sat, 22 Aug 2015 14:30:53 +0000 (+0530) Subject: CRM-16719: indentation fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=906a298cf78c8cfa77b9833a8de49c0986eb143a;p=civicrm-core.git CRM-16719: indentation fixes --- diff --git a/sql/GenerateData.php b/sql/GenerateData.php index 96572332d0..2798f7bd86 100644 --- a/sql/GenerateData.php +++ b/sql/GenerateData.php @@ -1,29 +1,29 @@ numIndividual = self::INDIVIDUAL_PERCENT * self::NUM_CONTACT / 100; $this->numHousehold = self::HOUSEHOLD_PERCENT * self::NUM_CONTACT / 100; @@ -211,13 +211,13 @@ class CRM_GCD { 1 => array( 1 => 'Mrs.', 2 => 'Ms.', - 4 => 'Dr.' + 4 => 'Dr.', ), // Male 2 => array( 3 => 'Mr.', 4 => 'Dr.', - ) + ), ); private $suffix = array(1 => 'Jr.', 2 => 'Sr.', 3 => 'II', 4 => 'III'); private $gender = array(1 => 'female', 2 => 'male'); @@ -266,7 +266,9 @@ class CRM_GCD { * @return string */ - // get a randomly generated string + /** + * get a randomly generated string + */ private function randomString($size = 32) { $string = ""; @@ -306,7 +308,7 @@ class CRM_GCD { } if (!$items) { echo "Error: no items found for '$key'\n"; - return; + return FALSE; } return $items[mt_rand(0, count($items) - 1)]; } @@ -465,7 +467,7 @@ class CRM_GCD { /** * Fetch contact type based on stored mapping * @param $id - * @return + * @return string $type */ private function getContactType($id) { foreach (array('Individual', 'Household', 'Organization') as $type) { @@ -880,7 +882,6 @@ class CRM_GCD { $params['street_address'] = $params['street_number'] . $params['street_number_suffix'] . " " . $params['street_name'] . " " . $params['street_type'] . " " . $params['street_number_postdirectional']; - if ($params['location_type_id'] == self::MAIN) { $params['supplemental_address_1'] = $this->randomItem('supplemental_addresses_1'); } @@ -952,7 +953,7 @@ class CRM_GCD { * @return array */ private function _addWebsite($cid, $name) { - $part = array_pad(split(' ', strtolower($name)), 3, ''); + $part = array_pad(explode(' ', strtolower($name)), 3, ''); if (count($part) > 3) { // Abbreviate the place name if it's two words $domain = $part[0][0] . $part[1][0] . $part[2] . $part[3]; @@ -963,9 +964,11 @@ class CRM_GCD { case 1: $domain = $part[0] . $part[1] . $part[2]; break; + case 2: $domain = $part[0] . $part[1]; break; + case 3: $domain = $part[0] . $part[2]; break; @@ -1001,18 +1004,23 @@ class CRM_GCD { case 1: $email = $first . $last; break; + case 2: $email = "$last.$first"; break; + case 3: $email = $last . $f; break; + case 4: $email = $first . $l; break; + case 5: $email = "$last.$m$first"; break; + case 6: $email = "$f$m$last"; break; @@ -1092,7 +1100,6 @@ class CRM_GCD { // always add members $groupContact->status = 'Added'; - $subscriptionHistory = new CRM_Contact_DAO_SubscriptionHistory(); $subscriptionHistory->contact_id = $groupContact->contact_id; @@ -1224,7 +1231,7 @@ class CRM_GCD { /** * @return array */ - function getZipCodeInfo() { + public function getZipCodeInfo() { if (!$this->stateMap) { $query = 'SELECT id, name, abbreviation from civicrm_state_province where country_id = 1228'; @@ -1260,7 +1267,7 @@ class CRM_GCD { * * @return array */ - static function getLatLong($zipCode) { + public static function getLatLong($zipCode) { $query = "http://maps.google.com/maps?q=$zipCode&output=js"; $userAgent = "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0"; @@ -1410,7 +1417,7 @@ VALUES * * @return string */ - static function repairDate($date) { + public static function repairDate($date) { $dropArray = array('-' => '', ':' => '', ' ' => ''); return strtr($date, $dropArray); } @@ -1867,7 +1874,7 @@ WHERE cefa.account_relationship = 1"; 'contribution_id' => $result->contribution_id, 'to_financial_account_id' => empty($financialAccountId[$result->payment_instrument_id]) ? $defaultFinancialAccount : $financialAccountId[$result->payment_instrument_id], 'payment_instrument_id' => $result->payment_instrument_id, - 'check_number' => $result->check_number + 'check_number' => $result->check_number, ); $trxn = CRM_Core_BAO_FinancialTrxn::create($trxnParams); $financialItem = array( @@ -1879,7 +1886,7 @@ WHERE cefa.account_relationship = 1"; 'contact_id' => $result->contact_id, 'entity_table' => 'civicrm_line_item', 'description' => $result->label, - 'financial_account_id' => $result->financial_account_id + 'financial_account_id' => $result->financial_account_id, ); $trxnId['id'] = $trxn->id; CRM_Financial_BAO_FinancialItem::create($financialItem, NULL, $trxnId); @@ -1964,6 +1971,7 @@ AND a.details = 'Participant Payment' "; $this->_query($sql); } + } /**