From: Tim Otten Date: Fri, 9 Jan 2015 02:06:41 +0000 (-0800) Subject: INFRA-132 - s/true/TRUE/ X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4eeb9a5b6f881b04411a9681ef3e8859e780616b;p=civicrm-core.git INFRA-132 - s/true/TRUE/ --- diff --git a/CRM/Contact/BAO/Contact/Optimizer.php b/CRM/Contact/BAO/Contact/Optimizer.php index bcf8a33157..6cf962ba1b 100644 --- a/CRM/Contact/BAO/Contact/Optimizer.php +++ b/CRM/Contact/BAO/Contact/Optimizer.php @@ -58,7 +58,7 @@ class CRM_Contact_BAO_Contact_Optimizer { } // check if we had a value in the old - $oldEmpty = $newEmpty = true; + $oldEmpty = $newEmpty = TRUE; $old = $new = array(); foreach ($oldWebsiteValues as $idx => $value) { @@ -93,7 +93,7 @@ class CRM_Contact_BAO_Contact_Optimizer { $old['website_type_id'] == $new['website_type_id'] && $old['url'] == $new['url'] ) { - $found = true; + $found = TRUE; unset($new[$newID]); break; } @@ -121,7 +121,7 @@ class CRM_Contact_BAO_Contact_Optimizer { } // check if we had a value in the old - $oldEmpty = $newEmpty = true; + $oldEmpty = $newEmpty = TRUE; $old = $new = array(); foreach ($oldEmailValues as $idx => $value) { @@ -172,7 +172,7 @@ class CRM_Contact_BAO_Contact_Optimizer { $old['email_type_id'] == $new['email_type_id'] && $old['url'] == $new['url'] ) { - $found = true; + $found = TRUE; unset($new[$newID]); break; } diff --git a/CRM/Contact/BAO/Group.php b/CRM/Contact/BAO/Group.php index 843fca7c4d..c60eff217f 100644 --- a/CRM/Contact/BAO/Group.php +++ b/CRM/Contact/BAO/Group.php @@ -941,7 +941,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group { $values[$object->id]['is_parent'] = false; if (array_key_exists('children', $values[$object->id])) { $values[$object->id]['class'][] = "crm-group-parent"; - $values[$object->id]['is_parent'] = true; + $values[$object->id]['is_parent'] = TRUE; } // If group is a child, add child class diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 7a347b5a24..863ad13a4a 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -332,7 +332,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { * @param bool $excludeHidden * * @return array (reference )|int $values the relevant data object values for the contact or - * the total count when $count is true + * the total count when $count is TRUE * * $access public */ diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 2ba68e681f..8948c33c97 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -43,7 +43,7 @@ class CRM_Contact_BAO_GroupContactCache extends CRM_Contact_DAO_GroupContactCach * @param $groupIDs * Of group that we are checking against. * - * @return boolean true if we did not regenerate, false if we did + * @return boolean TRUE if we did not regenerate, false if we did */ public static function check($groupIDs) { if (empty($groupIDs)) { @@ -121,7 +121,7 @@ AND ( g.cache_date IS NULL OR * @param int $limit * Limits the number of groups we evaluate. * - * @return boolean true if we did not regenerate, false if we did + * @return boolean TRUE if we did not regenerate, false if we did */ public static function loadAll($groupIDs = NULL, $limit = 0) { // ensure that all the smart groups are loaded @@ -291,7 +291,7 @@ WHERE id IN ( $groupIDs ) static $invoked = FALSE; // typically this needs to happy only once per instance - // this is especially true in import, where we dont need + // this is especially TRUE in import, where we dont need // to do this all the time // this optimization is done only when no groupID is passed // i.e. cache is reset for all groups @@ -397,7 +397,8 @@ WHERE id = %1 * Removes one or more contacts from the smart group cache * @param int|array $cid * @param int $groupId - * @return bool - true if successful + * @return bool + * TRUE if successful. */ public static function removeContact($cid, $groupId = NULL) { $cids = array(); diff --git a/CRM/Contact/Form/Edit/Individual.php b/CRM/Contact/Form/Edit/Individual.php index 627af134b9..e3d52678e0 100644 --- a/CRM/Contact/Form/Edit/Individual.php +++ b/CRM/Contact/Form/Edit/Individual.php @@ -152,7 +152,8 @@ class CRM_Contact_Form_Edit_Individual { * The uploaded files if any. * @param int $contactID * - * @return true if no errors, else array of errors + * @return bool + * TRUE if no errors, else array of errors. * @static */ public static function formRule($fields, $files, $contactID = NULL) { diff --git a/CRM/Contact/Form/Inline/Website.php b/CRM/Contact/Form/Inline/Website.php index 5f9e9394f4..f01c648a75 100644 --- a/CRM/Contact/Form/Inline/Website.php +++ b/CRM/Contact/Form/Inline/Website.php @@ -123,7 +123,7 @@ class CRM_Contact_Form_Inline_Website extends CRM_Contact_Form_Inline { $params = $this->exportValues(); // Process / save websites - CRM_Core_BAO_Website::create($params['website'], $this->_contactId, true); + CRM_Core_BAO_Website::create($params['website'], $this->_contactId, TRUE); $this->log(); $this->response(); diff --git a/CRM/Contact/Form/Search.php b/CRM/Contact/Form/Search.php index 66c096b2d8..8c6cf410f5 100644 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@ -533,8 +533,8 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { // get user submitted values // get it from controller only if form has been submitted, else preProcess has set this - // $this->controller->isModal( ) returns true if page is - // valid, i.e all the validations are true + // $this->controller->isModal( ) returns TRUE if page is + // valid, i.e all the validations are TRUE if (!empty($_POST) && !$this->controller->isModal()) { $this->_formValues = $this->controller->exportValues($this->_name); @@ -658,7 +658,7 @@ class CRM_Contact_Form_Search extends CRM_Core_Form_Search { $this->_params, $this->_returnProperties, $this->_action, - false, true, + false, TRUE, $this->_context, $this->_contextMenu ); diff --git a/CRM/Contact/Form/Search/Builder.php b/CRM/Contact/Form/Search/Builder.php index cfe0504ae4..e9850f164c 100644 --- a/CRM/Contact/Form/Search/Builder.php +++ b/CRM/Contact/Form/Search/Builder.php @@ -472,7 +472,7 @@ class CRM_Contact_Form_Search_Builder extends CRM_Contact_Form_Search { */ public static function checkArrayKeyEmpty($val) { if (is_array($val)) { - $v2empty = true; + $v2empty = TRUE; foreach ($val as $vk => $vv) { if (!empty($vk)) { $v2empty = false; diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index 767b262042..b491667cac 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -94,7 +94,7 @@ class CRM_Contact_Form_Search_Criteria { if (count($tags) && $key != 'civicrm_file' && $key != 'civicrm_contact') { //if tags exists then add type to display in adv search form help text $tagsTypes[] = ts($value); - $showAllTagTypes = true; + $showAllTagTypes = TRUE; } } $tagTypesText = implode(" or ", $tagsTypes); diff --git a/CRM/Contact/Form/Task/EmailCommon.php b/CRM/Contact/Form/Task/EmailCommon.php index e715b320f9..d1afbf7315 100644 --- a/CRM/Contact/Form/Task/EmailCommon.php +++ b/CRM/Contact/Form/Task/EmailCommon.php @@ -324,7 +324,7 @@ class CRM_Contact_Form_Task_EmailCommon { * @param array $self * Additional values form 'this'. * - * @return true if no errors, else array of errors + * @return TRUE if no errors, else array of errors * */ public static function formRule($fields, $dontCare, $self) { @@ -376,7 +376,7 @@ class CRM_Contact_Form_Task_EmailCommon { $allEmails = explode(',', $formValues[$element]); foreach ($allEmails as $value) { list($contactId, $email) = explode('::', $value); - $contactURL = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$contactId}", true); + $contactURL = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$contactId}", TRUE); switch ($element) { case 'cc_id': $ccValues['email'][] = '"' . $form->_contactDetails[$contactId]['sort_name'] . '" <' . $email . '>'; diff --git a/CRM/Contact/Form/Task/PDFLetterCommon.php b/CRM/Contact/Form/Task/PDFLetterCommon.php index 7ce4c846ec..2aaa42f5c9 100644 --- a/CRM/Contact/Form/Task/PDFLetterCommon.php +++ b/CRM/Contact/Form/Task/PDFLetterCommon.php @@ -209,7 +209,8 @@ class CRM_Contact_Form_Task_PDFLetterCommon { * @param array $self * Additional values form 'this'. * - * @return true if no errors, else array of errors + * @return bool + * TRUE if no errors, else array of errors. * */ public static function formRule($fields, $dontCare, $self) { diff --git a/CRM/Contribute/Form/UpdateSubscription.php b/CRM/Contribute/Form/UpdateSubscription.php index 7b934fbcec..3c47ffdc08 100644 --- a/CRM/Contribute/Form/UpdateSubscription.php +++ b/CRM/Contribute/Form/UpdateSubscription.php @@ -199,7 +199,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form { $message = ''; $params['subscriptionId'] = $this->_subscriptionDetails->subscription_id; - $updateSubscription = true; + $updateSubscription = TRUE; if ($this->_paymentProcessorObj->isSupported('changeSubscriptionAmount')) { $updateSubscription = $this->_paymentProcessorObj->changeSubscriptionAmount($message, $params); } diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index e59cea439c..9edc2974c9 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -133,7 +133,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { public static function retrieve(&$params, &$defaults) { $financialItem = new CRM_Financial_DAO_FinancialTrxn(); $financialItem->copyValues($params); - if ($financialItem->find(true)) { + if ($financialItem->find(TRUE)) { CRM_Core_DAO::storeValues($financialItem, $defaults); return $financialItem; } @@ -296,7 +296,8 @@ WHERE lt.entity_id = %1 "; * Delete financial transaction * * @param int $entity_id - * @return true on success, false otherwise + * @return bool + * TRUE on success, false otherwise. * @static */ public static function deleteFinancialTrxn($entity_id) { diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index a205b8cfab..f68ed7b97f 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -221,10 +221,10 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { $bodyType = "body_{$value}"; if ($$bodyType) { CRM_Utils_Token::replaceGreetingTokens($$bodyType, NULL, $contact['contact_id']); - $$bodyType = CRM_Utils_Token::replaceDomainTokens($$bodyType, $domain, true, $tokens, true); - $$bodyType = CRM_Utils_Token::replaceContactTokens($$bodyType, $contact, false, $tokens, false, true); - $$bodyType = CRM_Utils_Token::replaceComponentTokens($$bodyType, $contact, $tokens, true); - $$bodyType = CRM_Utils_Token::replaceHookTokens($$bodyType, $contact , $categories, true); + $$bodyType = CRM_Utils_Token::replaceDomainTokens($$bodyType, $domain, TRUE, $tokens, TRUE); + $$bodyType = CRM_Utils_Token::replaceContactTokens($$bodyType, $contact, false, $tokens, false, TRUE); + $$bodyType = CRM_Utils_Token::replaceComponentTokens($$bodyType, $contact, $tokens, TRUE); + $$bodyType = CRM_Utils_Token::replaceHookTokens($$bodyType, $contact , $categories, TRUE); } } $html = $body_html; @@ -238,9 +238,9 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { // do replacements in message subject $messageSubject = CRM_Utils_Token::replaceContactTokens($body_subject, $contact, false, $tokens); - $messageSubject = CRM_Utils_Token::replaceDomainTokens($messageSubject, $domain, true, $tokens); - $messageSubject = CRM_Utils_Token::replaceComponentTokens($messageSubject, $contact, $tokens, true); - $messageSubject = CRM_Utils_Token::replaceHookTokens($messageSubject, $contact, $categories, true); + $messageSubject = CRM_Utils_Token::replaceDomainTokens($messageSubject, $domain, TRUE, $tokens); + $messageSubject = CRM_Utils_Token::replaceComponentTokens($messageSubject, $contact, $tokens, TRUE); + $messageSubject = CRM_Utils_Token::replaceHookTokens($messageSubject, $contact, $categories, TRUE); $messageSubject = $smarty->fetch("string:{$messageSubject}"); diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index 227c9ac743..a608743a17 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -739,7 +739,7 @@ ORDER BY parent_id, weight"; $parentClause = 'parent_id IS NULL'; } - $incrementOtherNodes = true; + $incrementOtherNodes = TRUE; $sql = "SELECT weight from civicrm_navigation WHERE {$parentClause} ORDER BY weight LIMIT %1, 1"; $params = array(1 => array($position, 'Positive')); $newWeight = CRM_Core_DAO::singleValueQuery($sql, $params); diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index ada9528dbe..6ceae0068a 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -51,7 +51,7 @@ * 'class' => FIELD_CLASS_TYPE, * 'primary' => BOOLEAN, * 'required' => BOOLEAN, - * 'searchable' => true, + * 'searchable' => TRUE, * 'fk_table_name' => FOREIGN_KEY_TABLE_NAME, * 'fk_field_name' => FOREIGN_KEY_FIELD_NAME, * 'comment' => COMMENT, @@ -66,7 +66,7 @@ class CRM_Core_BAO_SchemaHandler { * * @param array $params * - * @return true if successfully created, false otherwise + * @return TRUE if successfully created, false otherwise * * @static */ @@ -366,7 +366,8 @@ ALTER TABLE {$tableName} * @param String $tableName * Name of the table to be created. * - * @return true if successfully deleted, false otherwise + * @return bool + * TRUE if successfully deleted, false otherwise. * * @static */ diff --git a/CRM/Core/Invoke.php b/CRM/Core/Invoke.php index 667b9c8ea4..73a35cc9a4 100644 --- a/CRM/Core/Invoke.php +++ b/CRM/Core/Invoke.php @@ -86,7 +86,7 @@ class CRM_Core_Invoke { // Symfony-based invocation path require_once CIVICRM_SYMFONY_PATH . '/app/bootstrap.php.cache'; require_once CIVICRM_SYMFONY_PATH . '/app/AppKernel.php'; - $kernel = new AppKernel('dev', true); + $kernel = new AppKernel('dev', TRUE); $kernel->loadClassCache(); $response = $kernel->handle(Symfony\Component\HttpFoundation\Request::createFromGlobals()); if (preg_match(':^text/html:', $response->headers->get('Content-Type'))) { @@ -299,7 +299,7 @@ class CRM_Core_Invoke { $addSequence = $addSequence ? 'true' : 'false'; unset($pageArgs['addSequence']); } - $object = new $item['page_callback'] ($title, true, $mode, NULL, $addSequence); + $object = new $item['page_callback'] ($title, TRUE, $mode, NULL, $addSequence); } else { CRM_Core_Error::fatal(); diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index f67dceeeec..ccad8f888b 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -613,13 +613,13 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { // CRM-14492 Admin price fields should show up on event registration if user has 'administer CiviCRM' permissions $adminFieldVisible = false; if (CRM_Core_Permission::check('administer CiviCRM')) { - $adminFieldVisible = true; + $adminFieldVisible = TRUE; } foreach ($form->_feeBlock as $field) { // public AND admin visibility fields are included for back-office registration and back-office change selections if (CRM_Utils_Array::value('visibility', $field) == 'public' || - (CRM_Utils_Array::value('visibility', $field) == 'admin' && $adminFieldVisible == true) || + (CRM_Utils_Array::value('visibility', $field) == 'admin' && $adminFieldVisible == TRUE) || $className == 'CRM_Event_Form_Participant' || $className == 'CRM_Event_Form_ParticipantFeeSelection' ) { @@ -803,7 +803,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { * @param $self * * - * @return true if no errors, else array of errors + * @return TRUE if no errors, else array of errors * @static */ public static function formRule($fields, $files, $self) { diff --git a/CRM/Event/Page/EventInfo.php b/CRM/Event/Page/EventInfo.php index 8d9583ba9a..3bdf94b7f9 100644 --- a/CRM/Event/Page/EventInfo.php +++ b/CRM/Event/Page/EventInfo.php @@ -122,7 +122,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page { // CRM-14492 Admin price fields should show up on event registration if user has 'administer CiviCRM' permissions $adminFieldVisible = false; if (CRM_Core_Permission::check('administer CiviCRM')) { - $adminFieldVisible = true; + $adminFieldVisible = TRUE; } foreach ($priceSetFields as $fid => $fieldValues) {